refactor(github-webhook): restructure application processing by grouping applications by server for improved deployment handling

This commit is contained in:
Andras Bacsai committed 2025-09-10 09:30:43 +02:00
1 parent 40f2471c5a
commit 52312e9de6
2 files changed
+266 -254

No files matched your search

+1 -1
View File
@@ -147,7 +147,7 @@ function next_after_cancel(?Server $server = null)
foreach ($next_found as $next) {
$server = Server::find($next->server_id);
$concurrent_builds = $server->settings->concurrent_builds;
$inprogress_deployments = ApplicationDeploymentQueue::where('server_id', $next->server_id)->whereIn('status', [ApplicationDeploymentStatus::QUEUED])->get()->sortByDesc('created_at');
$inprogress_deployments = ApplicationDeploymentQueue::where('server_id', $next->server_id)->whereIn('status', [ApplicationDeploymentStatus::IN_PROGRESS])->get()->sortByDesc('created_at');
if ($inprogress_deployments->count() < $concurrent_builds) {
$next->update([
'status' => ApplicationDeploymentStatus::IN_PROGRESS->value,