Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/daemon/workers/storage/PhabricatorWorkerTask.php
| <?php | <?php | ||||
| abstract class PhabricatorWorkerTask extends PhabricatorWorkerDAO { | abstract class PhabricatorWorkerTask extends PhabricatorWorkerDAO { | ||||
| // NOTE: If you provide additional fields here, make sure they are handled | // NOTE: If you provide additional fields here, make sure they are handled | ||||
| // correctly in the archiving process. | // correctly in the archiving process. | ||||
| protected $taskClass; | protected $taskClass; | ||||
| protected $leaseOwner; | protected $leaseOwner; | ||||
| protected $leaseExpires; | protected $leaseExpires; | ||||
| protected $failureCount; | protected $failureCount; | ||||
| protected $dataID; | protected $dataID; | ||||
| protected $priority; | protected $priority; | ||||
| protected $objectPHID; | |||||
| private $data; | private $data; | ||||
| private $executionException; | private $executionException; | ||||
| public function getConfiguration() { | public function getConfiguration() { | ||||
| return array( | return array( | ||||
| self::CONFIG_COLUMN_SCHEMA => array( | self::CONFIG_COLUMN_SCHEMA => array( | ||||
| 'taskClass' => 'text64', | 'taskClass' => 'text64', | ||||
| 'leaseOwner' => 'text64?', | 'leaseOwner' => 'text64?', | ||||
| 'leaseExpires' => 'epoch?', | 'leaseExpires' => 'epoch?', | ||||
| 'failureCount' => 'uint32', | 'failureCount' => 'uint32', | ||||
| 'failureTime' => 'epoch?', | 'failureTime' => 'epoch?', | ||||
| 'priority' => 'uint32', | 'priority' => 'uint32', | ||||
| 'objectPHID' => 'phid?', | |||||
| ), | |||||
| self::CONFIG_KEY_SCHEMA => array( | |||||
| 'key_object' => array( | |||||
epriestley: For consistency, prefer `key_object`.
(Do the subclasses override this and do anything funky? | |||||
| 'columns' => array('objectPHID'), | |||||
| ), | |||||
| ), | ), | ||||
| ) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
| } | } | ||||
| final public function setExecutionException(Exception $execution_exception) { | final public function setExecutionException(Exception $execution_exception) { | ||||
| $this->executionException = $execution_exception; | $this->executionException = $execution_exception; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| Show All 36 Lines | |||||
For consistency, prefer key_object.
(Do the subclasses override this and do anything funky? I seem to remember there being some weird things here. I'd expect the subclasses might need to do a $value = $value + $parent[self::CONFIG_KEY_SCHEMA] sort of thing, or we'll end up with a bunch of database issues and/or storage adjust destroying a pile of keys?)