Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14411066
D14235.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14235.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:42 AM (10 h, 55 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6925688
Default Alt Text
D14235.diff (2 KB)
Attached To
Mode
D14235: Allow PhabricatorWorker->queueTask() to take full $options
Attached
Detach File
Event Timeline
Log In to Comment