mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-03 07:12:33 +00:00
Update app/Jobs/DeleteResourceJob.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
ae6ad5175a
commit
e79316c8b5
1 file changed
+3
-3
@@ -125,15 +125,15 @@ class DeleteResourceJob implements ShouldBeEncrypted, ShouldQueue
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cancel any active deployments for this PR (same logic as API cancel_deployment)
|
// Cancel any active deployments for this PR (same logic as API cancel_deployment)
|
||||||
$activeDeployment = \App\Models\ApplicationDeploymentQueue::where('application_id', $application->id)
|
$activeDeployments = \App\Models\ApplicationDeploymentQueue::where('application_id', $application->id)
|
||||||
->where('pull_request_id', $pull_request_id)
|
->where('pull_request_id', $pull_request_id)
|
||||||
->whereIn('status', [
|
->whereIn('status', [
|
||||||
\App\Enums\ApplicationDeploymentStatus::QUEUED->value,
|
\App\Enums\ApplicationDeploymentStatus::QUEUED->value,
|
||||||
\App\Enums\ApplicationDeploymentStatus::IN_PROGRESS->value,
|
\App\Enums\ApplicationDeploymentStatus::IN_PROGRESS->value,
|
||||||
])
|
])
|
||||||
->first();
|
->get();
|
||||||
|
|
||||||
if ($activeDeployment) {
|
foreach ($activeDeployments as $activeDeployment) {
|
||||||
try {
|
try {
|
||||||
// Mark deployment as cancelled
|
// Mark deployment as cancelled
|
||||||
$activeDeployment->update([
|
$activeDeployment->update([
|
||||||
|
|||||||
Reference in new issue
Block a user