public function save() { $conn_w = $this->establishConnection('w'); $this->openTransaction(); $next_version = LiskDAO::loadNextCounterValue($conn_w, PhabricatorTriggerDaemon::COUNTER_VERSION); $this->setTriggerVersion($next_version); $result = parent::save(); $this->saveTransaction(); return $this; }
public function save() { if ($this->leaseOwner) { $current_server_time = $this->serverTime + (time() - $this->localTime); if ($current_server_time >= $this->leaseExpires) { throw new Exception("Trying to update task after lease expiration!"); } } $is_new = !$this->getID(); if ($is_new) { $this->failureCount = 0; } if ($is_new && $this->data) { $data = new PhabricatorWorkerTaskData(); $data->setData($this->data); $data->save(); $this->setDataID($data->getID()); } return parent::save(); }
protected function getConfiguration() { return array(self::CONFIG_COLUMN_SCHEMA => array('taskClass' => 'text64', 'leaseOwner' => 'text64?', 'leaseExpires' => 'epoch?', 'failureCount' => 'uint32', 'failureTime' => 'epoch?', 'priority' => 'uint32', 'objectPHID' => 'phid?'), self::CONFIG_KEY_SCHEMA => array('key_object' => array('columns' => array('objectPHID')))) + parent::getConfiguration(); }
protected function getConfiguration() { return array(self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array('parameters' => self::SERIALIZATION_JSON), self::CONFIG_COLUMN_SCHEMA => array('jobTypeKey' => 'text32', 'status' => 'text32', 'size' => 'uint32'), self::CONFIG_KEY_SCHEMA => array('key_type' => array('columns' => array('jobTypeKey')), 'key_author' => array('columns' => array('authorPHID')), 'key_status' => array('columns' => array('status')))) + parent::getConfiguration(); }
public function getConfiguration() { return array(self::CONFIG_TIMESTAMPS => false, self::CONFIG_SERIALIZATION => array('data' => self::SERIALIZATION_JSON)) + parent::getConfiguration(); }
protected function getConfiguration() { return array(self::CONFIG_TIMESTAMPS => false, self::CONFIG_COLUMN_SCHEMA => array('lastEventEpoch' => 'epoch?', 'nextEventEpoch' => 'epoch?'), self::CONFIG_KEY_SCHEMA => array('key_trigger' => array('columns' => array('triggerID'), 'unique' => true), 'key_next' => array('columns' => array('nextEventEpoch')))) + parent::getConfiguration(); }
protected function getConfiguration() { return array(self::CONFIG_TIMESTAMPS => false, self::CONFIG_SERIALIZATION => array('data' => self::SERIALIZATION_JSON), self::CONFIG_COLUMN_SCHEMA => array('status' => 'text32'), self::CONFIG_KEY_SCHEMA => array('key_job' => array('columns' => array('bulkJobPHID', 'status')), 'key_object' => array('columns' => array('objectPHID')))) + parent::getConfiguration(); }