| @@ 88-100 (lines=13) @@ | ||
| 85 | // Disallow concurrent deployments (don't rely on queuing implementation to restrict this) |
|
| 86 | // Only consider deployments started in the last 30 minutes (older jobs probably got stuck) |
|
| 87 | $runningDeployments = $environment->runningDeployments()->exclude('ID', $this->args['deploymentID']); |
|
| 88 | if($runningDeployments->count()) { |
|
| 89 | $runningDeployment = $runningDeployments->first(); |
|
| 90 | $log->write(sprintf( |
|
| 91 | '[-] Error: another deployment is in progress (started at %s by %s)', |
|
| 92 | $runningDeployment->dbObject('Created')->Nice(), |
|
| 93 | $runningDeployment->Deployer()->Title |
|
| 94 | )); |
|
| 95 | throw new RuntimeException(sprintf( |
|
| 96 | 'Another deployment is in progress (started at %s by %s)', |
|
| 97 | $runningDeployment->dbObject('Created')->Nice(), |
|
| 98 | $runningDeployment->Deployer()->Title |
|
| 99 | )); |
|
| 100 | } |
|
| 101 | ||
| 102 | $environment->Backend()->deploy( |
|
| 103 | $environment, |
|
| @@ 41-53 (lines=13) @@ | ||
| 38 | )) |
|
| 39 | ->exclude('ID', $dataTransfer->ID); |
|
| 40 | ||
| 41 | if($runningTransfers->count()) { |
|
| 42 | $runningTransfer = $runningTransfers->first(); |
|
| 43 | $log->write(sprintf( |
|
| 44 | '[-] Error: another transfer is in progress (started at %s by %s)', |
|
| 45 | $runningTransfer->dbObject('Created')->Nice(), |
|
| 46 | $runningTransfer->Author()->Title |
|
| 47 | )); |
|
| 48 | throw new RuntimeException(sprintf( |
|
| 49 | 'Another transfer is in progress (started at %s by %s)', |
|
| 50 | $runningTransfer->dbObject('Created')->Nice(), |
|
| 51 | $runningTransfer->Author()->Title |
|
| 52 | )); |
|
| 53 | } |
|
| 54 | ||
| 55 | ||
| 56 | // before we push data to an environment, we'll make a backup first |
|