Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/storage/DrydockLease.php
| Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | private function assertActive() { | ||||
| if (!$this->isActive()) { | if (!$this->isActive()) { | ||||
| throw new Exception( | throw new Exception( | ||||
| 'Lease is not active! You can not interact with resources through '. | 'Lease is not active! You can not interact with resources through '. | ||||
| 'an inactive lease.'); | 'an inactive lease.'); | ||||
| } | } | ||||
| } | } | ||||
| public static function waitForLeases(array $leases) { | public static function waitForLeases(array $leases) { | ||||
| assert_instances_of($leases, 'DrydockLease'); | assert_instances_of($leases, __CLASS__); | ||||
| $task_ids = array_filter(mpull($leases, 'getTaskID')); | $task_ids = array_filter(mpull($leases, 'getTaskID')); | ||||
| PhabricatorWorker::waitForTasks($task_ids); | PhabricatorWorker::waitForTasks($task_ids); | ||||
| $unresolved = $leases; | $unresolved = $leases; | ||||
| while (true) { | while (true) { | ||||
| foreach ($unresolved as $key => $lease) { | foreach ($unresolved as $key => $lease) { | ||||
| ▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines | |||||