Add Retry-After header to 429 rate limit responses

Adds Retry-After: 60 header to all deployment queue full responses,
helping webhook clients know when to retry their requests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-12-11 11:02:29 +01:00
parent 6d16f52143
commit d019553809
5 changed files with 12 additions and 12 deletions

View File

@@ -124,7 +124,7 @@ class Gitea extends Controller
is_webhook: true,
);
if ($result['status'] === 'queue_full') {
return response($result['message'], 429);
return response($result['message'], 429)->header('Retry-After', 60);
} elseif ($result['status'] === 'skipped') {
$return_payloads->push([
'application' => $application->name,
@@ -196,7 +196,7 @@ class Gitea extends Controller
git_type: 'gitea'
);
if ($result['status'] === 'queue_full') {
return response($result['message'], 429);
return response($result['message'], 429)->header('Retry-After', 60);
} elseif ($result['status'] === 'skipped') {
$return_payloads->push([
'application' => $application->name,