mirror of
https://github.com/nukesor/pueue
synced 2024-09-06 16:03:26 +00:00
Improve comment / function name
This commit is contained in:
parent
33d1d7cc9e
commit
77bf9b0318
|
@ -28,7 +28,7 @@ pub enum SubCommand {
|
|||
delay_until: Option<DateTime<Local>>,
|
||||
|
||||
/// Start the task once all specified tasks have successfully finished.
|
||||
/// If one of the dependencies failed, this task will be marked as failed
|
||||
/// As soon as one of the dependencies fails, this task will be fail as well
|
||||
#[structopt(name = "after", long)]
|
||||
dependencies: Vec<usize>,
|
||||
},
|
||||
|
|
|
@ -71,7 +71,7 @@ impl TaskHandler {
|
|||
self.receive_commands();
|
||||
self.process_finished();
|
||||
self.check_stashed();
|
||||
self.state.lock().unwrap().update_dependencies();
|
||||
self.state.lock().unwrap().check_failed_dependencies();
|
||||
if self.running && !self.reset {
|
||||
let _res = self.check_new();
|
||||
}
|
||||
|
|
|
@ -42,10 +42,11 @@ impl State {
|
|||
self.max_id - 1
|
||||
}
|
||||
|
||||
/// Search and return the next runnable task.
|
||||
/// A runnable task:
|
||||
/// - is in Queued state
|
||||
/// - has all its dependencies in `Done` state
|
||||
pub fn get_next_task_id(&mut self) -> Option<usize> {
|
||||
// A runnable task:
|
||||
// - is in Queued state
|
||||
// - has all task in Done state
|
||||
return self
|
||||
.tasks
|
||||
.iter()
|
||||
|
@ -305,8 +306,8 @@ impl State {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Checkek that any Queued tasks dont have any failed dependencies, otherwise marked it as failed
|
||||
pub fn update_dependencies(&mut self) {
|
||||
/// Ensure that no `Queued` tasks dont have any failed dependencies, otherwise set their status to `Failed`.
|
||||
pub fn check_failed_dependencies(&mut self) {
|
||||
let has_failed_deps: Vec<_> = self
|
||||
.tasks
|
||||
.iter()
|
||||
|
|
Loading…
Reference in a new issue