mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-29 04:19:30 +00:00
fix: Treat 429 (cycle already running) as success in workflows
When MAX_CONCURRENT=1 and a cycle is in progress, the trigger server returns 429. This is expected behavior, not an error — the previous curl -f treated it as failure (exit code 22). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5db68ea8d8
commit
6b5a547e2d
2 changed files with 24 additions and 4 deletions
14
.github/workflows/improve.yml
vendored
14
.github/workflows/improve.yml
vendored
|
|
@ -20,5 +20,15 @@ jobs:
|
|||
SPRITE_URL: ${{ secrets.DISCOVERY_SPRITE_URL }}
|
||||
TRIGGER_SECRET: ${{ secrets.DISCOVERY_TRIGGER_SECRET }}
|
||||
run: |
|
||||
curl -sf -X POST "${SPRITE_URL}/trigger?reason=${{ github.event_name }}" \
|
||||
-H "Authorization: Bearer ${TRIGGER_SECRET}"
|
||||
HTTP_CODE=$(curl -s -o /tmp/response.json -w '%{http_code}' -X POST \
|
||||
"${SPRITE_URL}/trigger?reason=${{ github.event_name }}" \
|
||||
-H "Authorization: Bearer ${TRIGGER_SECRET}")
|
||||
cat /tmp/response.json
|
||||
if [ "$HTTP_CODE" = "429" ]; then
|
||||
echo "Cycle already running, skipping"
|
||||
elif [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
|
||||
echo "Triggered successfully"
|
||||
else
|
||||
echo "Failed with HTTP $HTTP_CODE"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
14
.github/workflows/refactor.yml
vendored
14
.github/workflows/refactor.yml
vendored
|
|
@ -20,5 +20,15 @@ jobs:
|
|||
SPRITE_URL: ${{ secrets.REFACTOR_SPRITE_URL }}
|
||||
TRIGGER_SECRET: ${{ secrets.REFACTOR_TRIGGER_SECRET }}
|
||||
run: |
|
||||
curl -sf -X POST "${SPRITE_URL}/trigger?reason=${{ github.event_name }}&issue=${{ github.event.issue.number || '' }}" \
|
||||
-H "Authorization: Bearer ${TRIGGER_SECRET}"
|
||||
HTTP_CODE=$(curl -s -o /tmp/response.json -w '%{http_code}' -X POST \
|
||||
"${SPRITE_URL}/trigger?reason=${{ github.event_name }}&issue=${{ github.event.issue.number || '' }}" \
|
||||
-H "Authorization: Bearer ${TRIGGER_SECRET}")
|
||||
cat /tmp/response.json
|
||||
if [ "$HTTP_CODE" = "429" ]; then
|
||||
echo "Cycle already running, skipping"
|
||||
elif [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then
|
||||
echo "Triggered successfully"
|
||||
else
|
||||
echo "Failed with HTTP $HTTP_CODE"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue