public function forceSaveWithoutLease()
 {
     $is_new = !$this->getID();
     if ($is_new) {
         $this->failureCount = 0;
     }
     if ($is_new && $this->getData() !== null) {
         $data = new PhabricatorWorkerTaskData();
         $data->setData($this->getData());
         $data->save();
         $this->setDataID($data->getID());
     }
     return parent::save();
 }
Exemplo n.º 2
0
 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();
 }