diff --git a/cpp/task_queue.cpp b/cpp/task_queue.cpp index db61486..ea77596 100644 --- a/cpp/task_queue.cpp +++ b/cpp/task_queue.cpp @@ -164,7 +164,6 @@ void TaskQueue::worker_thread() { { // Remove the task from running_tasks_ - task_to_execute->save(0); std::lock_guard 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); } }