diff --git a/queued/hosting_queued.drush.inc b/queued/hosting_queued.drush.inc index 983c45f..6e44f5e 100644 --- a/queued/hosting_queued.drush.inc +++ b/queued/hosting_queued.drush.inc @@ -62,7 +62,7 @@ function drush_hosting_queued() { variable_set('hosting_queued_process_started', REQUEST_TIME); watchdog('hosting_queued', 'Started Hosting queue daemon, waiting for new tasks'); - + drush_log('Started hosting queue daemon. Waiting for new tasks.', 'ok'); while (TRUE) { try { // Should we terminate. @@ -85,10 +85,21 @@ function drush_hosting_queued() { drush_log(dt('Found task to execute. Pausing before execution.')); sleep(1); - watchdog('hosting_queued', 'Running task @nid.', array('@nid' => $task->nid)); + watchdog('hosting_task', 'Starting task "@title" [node/@nid]', array( + '@title' => $task->title, + '@nid' => $task->nid, + ), WATCHDOG_NOTICE, url("node/$task->nid")); + drush_log(dt('Starting task "@title" [node/@nid]', array( + '@title' => $task->title, + '@nid' => $task->nid, + )), 'ok'); + // Execute the task in the backend drush_invoke_process('@self', 'hosting-task', array($task->nid), array('strict' => FALSE), array('interactive' => TRUE)); - drush_log(dt('Finished executing task.')); + drush_log(dt('Finished task "@title" [node/@nid].', array( + '@title' => $task->title, + '@nid' => $task->nid, + )), 'ok'); // Delay for a configurable amount of time. $delay = variable_get('hosting_queued_post_task_delay', 0); diff --git a/task/hosting_task.module b/task/hosting_task.module index 598ae49..96c64ee 100644 --- a/task/hosting_task.module +++ b/task/hosting_task.module @@ -723,10 +723,25 @@ function hosting_task_set_title(&$node) { function hosting_tasks_queue($count = 20) { global $provision_errors; - drush_log(dt("Running tasks queue")); + drush_log(dt("Running tasks queue", "ok")); $tasks = _hosting_get_new_tasks($count); foreach ($tasks as $task) { + + watchdog('hosting_task', 'Starting task "@title" [node/@nid]', array( + '@title' => $task->title, + '@nid' => $task->nid, + ), WATCHDOG_NOTICE, url("node/$task->nid")); + drush_log(dt('Starting task "@title" [node/@nid]', array( + '@title' => $task->title, + '@nid' => $task->nid, + )), 'ok'); + drush_invoke_process('@self', "hosting-task", array($task->nid), array('strict' => FALSE), array('fork' => TRUE)); + + drush_log(dt('Finished task "@title" [node/@nid].', array( + '@title' => $task->title, + '@nid' => $task->nid, + )), 'ok'); } }