1313jobs :
1414 snapshot-balances :
1515 runs-on : ubuntu-latest
16+ timeout-minutes : 300 # 5 hours timeout (GitHub Actions max is 6 hours)
1617
1718 steps :
1819 - name : Checkout repository
@@ -27,22 +28,31 @@ jobs:
2728 - name : Install dependencies
2829 run : npm ci
2930
30- - name : Run balance snapshots
31- run : node scripts/balance-snapshots.js
31+ - name : Install script dependencies
32+ run : |
33+ cd scripts
34+ npm install
35+
36+ - name : Run batch snapshot orchestration
37+ run : |
38+ cd scripts
39+ npm start
3240 env :
3341 API_BASE_URL : " https://multisig.meshjs.dev"
3442 SNAPSHOT_AUTH_TOKEN : ${{ secrets.SNAPSHOT_AUTH_TOKEN }}
35- BATCH_SIZE : 3
36- DELAY_BETWEEN_REQUESTS : 3
37- DELAY_BETWEEN_BATCHES : 15
43+ BATCH_SIZE : 10
44+ DELAY_BETWEEN_BATCHES : 5
3845 MAX_RETRIES : 3
39- REQUEST_TIMEOUT : 30
4046
4147 - name : Notify on failure
4248 if : failure()
49+ # Send failure notification
4350 run : |
4451 echo "❌ Daily balance snapshot job failed"
45- # Optional: Send failure notification
46- # curl -X POST -H 'Content-type: application/json' \
47- # --data "{\"text\":\"❌ Daily balance snapshots failed. Check the GitHub Actions logs.\"}" \
48- # ${{ secrets.DISCORD_WEBHOOK_URL }}
52+ if [ -n "${{ secrets.SNAPSHOT_ERROR_DISCORD_WEBHOOK_URL }}" ]; then
53+ curl -X POST -H 'Content-type: application/json' \
54+ --data "{\"text\":\"❌ Daily balance snapshots failed. Check the GitHub Actions logs.\"}" \
55+ ${{ secrets.SNAPSHOT_ERROR_DISCORD_WEBHOOK_URL }} || echo "Failed to send Discord notification"
56+ else
57+ echo "SNAPSHOT_ERROR_DISCORD_WEBHOOK_URL not configured, skipping notification"
58+ fi
0 commit comments