Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/keepers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Keepers Schedule

on:
schedule:
# Accrual keeper: every 15 minutes
- cron: '*/15 * * * *'
# Rebalance keeper: every hour
- cron: '0 * * * *'
workflow_dispatch: # allow manual triggering for debugging

jobs:
trigger-keepers:
runs-on: ubuntu-latest

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No timeout-minutes on this job. A hung endpoint can block the runner up to GitHub's 6-hour default, which also delays the next scheduled tick if runs overlap.

steps:
- name: Trigger Accrual Keeper
if: github.event.schedule == '*/15 * * * *' || github.event_name == 'workflow_dispatch'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition and the one on line 22 both independently allow github.event_name == 'workflow_dispatch', so a manual run always fires accrual and rebalance together. Rebalance moves real funded-account positions, scope each step to its own manual case or split into separate jobs.

run: |
curl -f -X POST "${{ secrets.API_BASE_URL }}/api/v1/keepers/accrue" \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secrets.API_BASE_URL isn't documented anywhere (not in environment-variables.md, not in .env.example). Add it there, and add --max-time/--connect-timeout plus --retry, since a single transient 5xx here fails the whole run with no recovery until the next tick.

-H "Authorization: Bearer ${{ secrets.CRON_SECRET }}"

- name: Trigger Rebalance Keeper
if: github.event.schedule == '0 * * * *' || github.event_name == 'workflow_dispatch'
run: |
curl -f -X POST "${{ secrets.API_BASE_URL }}/api/v1/keepers/rebalance" \
-H "Authorization: Bearer ${{ secrets.CRON_SECRET }}"
Loading