diff --git a/hosting.queues.inc b/hosting.queues.inc index f9ffc54..2ea362d 100644 --- a/hosting.queues.inc +++ b/hosting.queues.inc @@ -153,7 +153,12 @@ function hosting_tasks_queue($count = 20) { drush_log(dt("Running tasks queue")); $tasks = _hosting_get_new_tasks($count); foreach ($tasks as $task) { - drush_backend_fork("hosting task", array($task->nid)); + // We remove this from the queue at the start of execution, + // otherwise, if it takes too long to run it might have a + // second thread spawned to process it. + $task->task_status = HOSTING_TASK_PROCESSING; + node_save($task); + drush_backend_fork("hosting task", array($task->nid)); } } diff --git a/task.hosting.inc b/task.hosting.inc index 14e502b..50c804e 100644 --- a/task.hosting.inc +++ b/task.hosting.inc @@ -24,13 +24,6 @@ function drush_hosting_hosting_task_validate($task) { $task->changed = mktime(); $task->executed = mktime(); $task->revision = FALSE; - - // We remove this from the queue at the start of execution, - // otherwise, if it takes too long to run it might have a - // second thread spawned to process it. - $task->task_status = HOSTING_TASK_PROCESSING; - node_save($task); - $task->options = array(); $task->args = array(); drush_set_context('HOSTING_TASK', $task);