Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
index 40606c3d61..f85f230c95 100644
--- a/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
+++ b/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php
@@ -1,55 +1,53 @@
<?php
final class PhabricatorTaskmasterDaemon extends PhabricatorDaemon {
protected function run() {
do {
$tasks = id(new PhabricatorWorkerLeaseQuery())
->setLimit(1)
->execute();
if ($tasks) {
$this->willBeginWork();
foreach ($tasks as $task) {
$id = $task->getID();
$class = $task->getTaskClass();
$this->log("Working on task {$id} ({$class})...");
$task = $task->executeTask();
$ex = $task->getExecutionException();
if ($ex) {
if ($ex instanceof PhabricatorWorkerPermanentFailureException) {
- $this->log(
- pht(
- 'Task %s failed permanently: %s',
- $id,
- $ex->getMessage()));
+ throw new PhutilProxyException(
+ pht('Permanent failure while executing Task ID %d.', $id),
+ $ex);
} else if ($ex instanceof PhabricatorWorkerYieldException) {
$this->log(pht('Task %s yielded.', $id));
} else {
$this->log("Task {$id} failed!");
throw new PhutilProxyException(
- "Error while executing task ID {$id} from queue.",
+ pht('Error while executing Task ID %d.', $id),
$ex);
}
} else {
$this->log("Task {$id} complete! Moved to archive.");
}
}
$sleep = 0;
} else {
// When there's no work, sleep for one second. The pool will
// autoscale down if we're continuously idle for an extended period
// of time.
$this->willBeginIdle();
$sleep = 1;
}
$this->sleep($sleep);
} while (!$this->shouldExit());
}
}
diff --git a/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php b/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php
index c90fac5897..45f5832124 100644
--- a/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php
+++ b/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementExecuteWorkflow.php
@@ -1,61 +1,61 @@
<?php
final class PhabricatorWorkerManagementExecuteWorkflow
extends PhabricatorWorkerManagementWorkflow {
protected function didConstruct() {
$this
->setName('execute')
->setExamples('**execute** --id __id__')
->setSynopsis(
pht(
'Execute a task explicitly. This command ignores leases, is '.
'dangerous, and may cause work to be performed twice.'))
->setArguments($this->getTaskSelectionArguments());
}
public function execute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
$tasks = $this->loadTasks($args);
foreach ($tasks as $task) {
$can_execute = !$task->isArchived();
if (!$can_execute) {
$console->writeOut(
"**<bg:yellow> %s </bg>** %s\n",
pht('ARCHIVED'),
pht(
'%s is already archived, and can not be executed.',
$this->describeTask($task)));
continue;
}
// NOTE: This ignores leases, maybe it should respect them without
// a parameter like --force?
$task->setLeaseOwner(null);
$task->setLeaseExpires(PhabricatorTime::getNow());
$task->save();
$task_data = id(new PhabricatorWorkerTaskData())->loadOneWhere(
'id = %d',
$task->getDataID());
$task->setData($task_data->getData());
$id = $task->getID();
$class = $task->getTaskClass();
$console->writeOut("Executing task {$id} ({$class})...");
- $task->executeTask();
+ $task = $task->executeTask();
$ex = $task->getExecutionException();
if ($ex) {
throw $ex;
}
}
return 0;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Mar 17, 2:25 AM (4 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
964275
Default Alt Text
(4 KB)

Event Timeline