Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/daemon/workers/__tests__/PhabricatorTestWorker.php
Show All 20 Lines | return idx( | ||||
$this->getTaskData(), | $this->getTaskData(), | ||||
'getWaitBeforeRetry', | 'getWaitBeforeRetry', | ||||
parent::getWaitBeforeRetry($task)); | parent::getWaitBeforeRetry($task)); | ||||
} | } | ||||
protected function doWork() { | protected function doWork() { | ||||
switch (idx($this->getTaskData(), 'doWork')) { | switch (idx($this->getTaskData(), 'doWork')) { | ||||
case 'fail-temporary': | case 'fail-temporary': | ||||
throw new Exception( | throw new Exception('Temporary failure!'); | ||||
'Temporary failure!'); | |||||
case 'fail-permanent': | case 'fail-permanent': | ||||
throw new PhabricatorWorkerPermanentFailureException( | throw new PhabricatorWorkerPermanentFailureException( | ||||
'Permanent failure!'); | 'Permanent failure!'); | ||||
default: | default: | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
} | } |