Differential D20200 Diff 48235 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; | ||||
protected $archivedEpoch; | |||||
protected function getConfiguration() { | protected function getConfiguration() { | ||||
$parent = parent::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; | ) + $parent; | ||||
$config[self::CONFIG_COLUMN_SCHEMA] = array( | $config[self::CONFIG_COLUMN_SCHEMA] = array( | ||||
'result' => 'uint32', | 'result' => 'uint32', | ||||
'duration' => 'uint64', | 'duration' => 'uint64', | ||||
'archivedEpoch' => 'epoch?', | |||||
) + $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'), | ||||
), | ), | ||||
'key_modified' => array( | 'key_modified' => array( | ||||
'columns' => array('dateModified'), | 'columns' => array('dateModified'), | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | $this->openTransaction(); | ||||
->setID($this->getID()) | ->setID($this->getID()) | ||||
->setTaskClass($this->getTaskClass()) | ->setTaskClass($this->getTaskClass()) | ||||
->setLeaseOwner(null) | ->setLeaseOwner(null) | ||||
->setLeaseExpires(0) | ->setLeaseExpires(0) | ||||
->setFailureCount(0) | ->setFailureCount(0) | ||||
->setDataID($this->getDataID()) | ->setDataID($this->getDataID()) | ||||
->setPriority($this->getPriority()) | ->setPriority($this->getPriority()) | ||||
->setObjectPHID($this->getObjectPHID()) | ->setObjectPHID($this->getObjectPHID()) | ||||
->setDateCreated($this->getDateCreated()) | |||||
->insert(); | ->insert(); | ||||
$this->setDataID(null); | $this->setDataID(null); | ||||
$this->delete(); | $this->delete(); | ||||
$this->saveTransaction(); | $this->saveTransaction(); | ||||
return $active; | return $active; | ||||
} | } | ||||
} | } |