feat: long running queue with 1 hour of timeout

This commit is contained in:
Andras Bacsai
2023-06-28 18:20:01 +02:00
parent ba18c589f0
commit 80af200c9f
9 changed files with 57 additions and 19 deletions

View File

@@ -34,7 +34,7 @@ function queue_application_deployment(int $application_id, string $deployment_uu
force_rebuild: $force_rebuild,
rollback_commit: $commit,
pull_request_id: $pull_request_id,
));
))->onConnection('long-running')->onQueue('long-running');
}
function queue_next_deployment(Application $application)
@@ -47,6 +47,6 @@ function queue_next_deployment(Application $application)
deployment_uuid: $next_found->deployment_uuid,
force_rebuild: $next_found->force_rebuild,
pull_request_id: $next_found->pull_request_id
));
))->onConnection('long-running')->onQueue('long-running');
}
}

View File

@@ -64,7 +64,7 @@ function git_api(GithubApp|GitlabApp $source, string $endpoint, string $method =
}
$json = $response->json();
if ($response->failed() && $throwError) {
throw new \Exception("Failed to get data from {$source->name} with error: " . $json['message']);
throw new \Exception("Failed to get data from {$source->name} with error:<br><br>" . $json['message']);
}
return [
'rate_limit_remaining' => $response->header('X-RateLimit-Remaining'),