Move to the database at the very end of a task

main
Simon Quigley 2 weeks ago
parent 91fb6f2548
commit 406fddb27b

@ -164,7 +164,6 @@ void TaskQueue::worker_thread() {
{
// Remove the task from running_tasks_
task_to_execute->save(0);
std::lock_guard<std::mutex> lock(running_tasks_mutex_);
int id = task_to_execute->id;
auto running_task_it = std::find_if(running_tasks_.begin(), running_tasks_.end(),
@ -186,5 +185,8 @@ void TaskQueue::worker_thread() {
running_pkgconfs_.erase(running_pkgconf_it);
}
}
// Save to the database at the end
task_to_execute->save(0);
}
}

Loading…
Cancel
Save