Skip to content

Commit

Permalink
Fix start time of tasks. Fixes #80
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukesor committed Apr 9, 2020
1 parent 462d202 commit 44be467
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions daemon/task_handler.rs
Expand Up @@ -177,6 +177,7 @@ impl TaskHandler {
self.children.insert(task_id, child);
info!("Started task: {}", task.command);

task.start = Some(Local::now());
task.status = TaskStatus::Running;

state.save();
Expand Down
5 changes: 0 additions & 5 deletions shared/state.rs
Expand Up @@ -53,11 +53,6 @@ impl State {

pub fn change_status(&mut self, id: usize, new_status: TaskStatus) {
if let Some(ref mut task) = self.tasks.get_mut(&id) {
if new_status == TaskStatus::Running {
if TaskStatus::Queued == task.status || TaskStatus::Stashed == task.status {
task.start = Some(Local::now());
}
}
task.status = new_status;
self.save();
};
Expand Down

0 comments on commit 44be467

Please sign in to comment.