fix(applications): include pull_request_id in deployment queue check to prevent duplicate deployments
This commit is contained in:
@@ -28,6 +28,7 @@ function queue_application_deployment(Application $application, string $deployme
|
|||||||
// Check if there's already a deployment in progress or queued for this application and commit
|
// Check if there's already a deployment in progress or queued for this application and commit
|
||||||
$existing_deployment = ApplicationDeploymentQueue::where('application_id', $application_id)
|
$existing_deployment = ApplicationDeploymentQueue::where('application_id', $application_id)
|
||||||
->where('commit', $commit)
|
->where('commit', $commit)
|
||||||
|
->where('pull_request_id', $pull_request_id)
|
||||||
->whereIn('status', [ApplicationDeploymentStatus::IN_PROGRESS->value, ApplicationDeploymentStatus::QUEUED->value])
|
->whereIn('status', [ApplicationDeploymentStatus::IN_PROGRESS->value, ApplicationDeploymentStatus::QUEUED->value])
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user