Move to the database at the very end of a task

This commit is contained in:
Simon Quigley 2025-01-26 23:40:58 -06:00
parent 91fb6f2548
commit 406fddb27b

View File

@ -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);
}
}