fort icon indicating copy to clipboard operation
fort copied to clipboard

Macro based on retries

Open vertexclique opened this issue 6 years ago • 4 comments
trafficstars

The macro should enable how many times a process can be restarted.

#[fort::root(max_retries=4)]
fn main {
    panic!("Killed");
}

Process output

Killed
Killed
Killed
Killed

vertexclique avatar Oct 27 '19 22:10 vertexclique

I will take this issue. @vertexclique

cptrodgers avatar Oct 29 '19 01:10 cptrodgers

what's going on with this?

imkow avatar Feb 14 '20 20:02 imkow

@imkow This feature went inside with Bastion itself: https://docs.rs/bastion/0.3.4/bastion/supervisor/struct.RestartStrategy.html

    /// #     use std::time::Duration;
    /// #     let actor_restart_strategy = ActorRestartStrategy::LinearBackOff {
    /// #         timeout: Duration::from_secs(5)
    /// #     };
    /// #     let restart_strategy = RestartStrategy::default()
    /// #        .with_actor_restart_strategy(actor_restart_strategy);

We will add this to fort asap. RestartStrategy::Tries is what you want to use.

vertexclique avatar Feb 15 '20 18:02 vertexclique

@vertexclique thx

imkow avatar Feb 16 '20 21:02 imkow