Differential D11044 Diff 26524 src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php
| <?php | <?php | ||||
| final class PhabricatorWorkerArchiveTask extends PhabricatorWorkerTask { | final class PhabricatorWorkerArchiveTask extends PhabricatorWorkerTask { | ||||
| const RESULT_SUCCESS = 0; | const RESULT_SUCCESS = 0; | ||||
| const RESULT_FAILURE = 1; | const RESULT_FAILURE = 1; | ||||
| const RESULT_CANCELLED = 2; | const RESULT_CANCELLED = 2; | ||||
| protected $duration; | protected $duration; | ||||
| protected $result; | protected $result; | ||||
| public function getConfiguration() { | public function getConfiguration() { | ||||
| $parent = parent::getConfiguration(); | |||||
| $config = array( | $config = array( | ||||
| // We manage the IDs in this table; they are allocated in the ActiveTask | // We manage the IDs in this table; they are allocated in the ActiveTask | ||||
| // table and moved here without alteration. | // table and moved here without alteration. | ||||
| self::CONFIG_IDS => self::IDS_MANUAL, | self::CONFIG_IDS => self::IDS_MANUAL, | ||||
| ) + parent::getConfiguration(); | ) + $parent; | ||||
| $config[self::CONFIG_COLUMN_SCHEMA] = array( | $config[self::CONFIG_COLUMN_SCHEMA] = array( | ||||
| 'result' => 'uint32', | 'result' => 'uint32', | ||||
| 'duration' => 'uint64', | 'duration' => 'uint64', | ||||
| ) + $config[self::CONFIG_COLUMN_SCHEMA]; | ) + $config[self::CONFIG_COLUMN_SCHEMA]; | ||||
| $config[self::CONFIG_KEY_SCHEMA] = array( | $config[self::CONFIG_KEY_SCHEMA] = array( | ||||
| 'dateCreated' => array( | 'dateCreated' => array( | ||||
| 'columns' => array('dateCreated'), | 'columns' => array('dateCreated'), | ||||
| ), | ), | ||||
| 'leaseOwner' => array( | 'leaseOwner' => array( | ||||
| 'columns' => array('leaseOwner', 'priority', 'id'), | 'columns' => array('leaseOwner', 'priority', 'id'), | ||||
| ), | ), | ||||
| ); | ) + $parent[self::CONFIG_KEY_SCHEMA]; | ||||
| return $config; | return $config; | ||||
| } | } | ||||
| public function save() { | public function save() { | ||||
| if ($this->getID() === null) { | if ($this->getID() === null) { | ||||
| throw new Exception('Trying to archive a task with no ID.'); | throw new Exception('Trying to archive a task with no ID.'); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines | |||||