Page MenuHomePhabricator

D14235.id34375.diff
No OneTemporary

D14235.id34375.diff

diff --git a/src/infrastructure/daemon/workers/PhabricatorWorker.php b/src/infrastructure/daemon/workers/PhabricatorWorker.php
--- a/src/infrastructure/daemon/workers/PhabricatorWorker.php
+++ b/src/infrastructure/daemon/workers/PhabricatorWorker.php
@@ -160,8 +160,7 @@
try {
$worker->doWork();
foreach ($worker->getQueuedTasks() as $queued_task) {
- list($queued_class, $queued_data, $queued_priority) = $queued_task;
- $queued_options = array('priority' => $queued_priority);
+ list($queued_class, $queued_data, $queued_options) = $queued_task;
self::scheduleTask($queued_class, $queued_data, $queued_options);
}
break;
@@ -220,11 +219,14 @@
*
* @param string Task class to queue.
* @param array Data for the followup task.
- * @param int|null Priority for the followup task.
+ * @param array Options for the followup task.
* @return this
*/
- final protected function queueTask($class, array $data, $priority = null) {
- $this->queuedTasks[] = array($class, $data, $priority);
+ final protected function queueTask(
+ $class,
+ array $data,
+ array $options = array()) {
+ $this->queuedTasks[] = array($class, $data, $options);
return $this;
}
diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
--- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
+++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
@@ -217,13 +217,14 @@
// so execute it out here and just let the exception escape.
if ($did_succeed) {
foreach ($worker->getQueuedTasks() as $task) {
- list($class, $data) = $task;
- PhabricatorWorker::scheduleTask(
- $class,
- $data,
- array(
- 'priority' => (int)$this->getPriority(),
- ));
+ list($class, $data, $options) = $task;
+
+ // Default the new task priority to our own priority.
+ $options = $options + array(
+ 'priority' => (int)$this->getPriority(),
+ );
+
+ PhabricatorWorker::scheduleTask($class, $data, $options);
}
}

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 12, 6:53 AM (1 w, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6732057
Default Alt Text
D14235.id34375.diff (2 KB)

Event Timeline