Exemplo n.º 1
0
 private function didActivate()
 {
     $viewer = PhabricatorUser::getOmnipotentUser();
     $need_update = false;
     $this->logEvent(DrydockLeaseActivatedLogType::LOGCONST);
     $commands = id(new DrydockCommandQuery())->setViewer($viewer)->withTargetPHIDs(array($this->getPHID()))->withConsumed(false)->execute();
     if ($commands) {
         $need_update = true;
     }
     if ($need_update) {
         $this->scheduleUpdate();
     }
     $expires = $this->getUntil();
     if ($expires) {
         $this->scheduleUpdate($expires);
     }
     $awaken_ids = $this->getAttribute('internal.awakenTaskIDs');
     if (is_array($awaken_ids) && $awaken_ids) {
         PhabricatorWorker::awakenTaskIDs($awaken_ids);
     }
 }
Exemplo n.º 2
0
 /**
  * Awaken yielded tasks after a state change.
  *
  * @return this
  */
 public function awakenTasks()
 {
     $awaken_ids = $this->getAttribute('internal.awakenTaskIDs');
     if (is_array($awaken_ids) && $awaken_ids) {
         PhabricatorWorker::awakenTaskIDs($awaken_ids);
     }
     return $this;
 }