All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 41s
- Add background scheduler in entrypoint: calls /api/cron/agents every 5 minutes to trigger due agents automatically - Recalculate stale nextRun (past dates) in getAgents() so the display always shows a future time - Agent card shows "En attente de déclenchement" instead of "il y a X" when nextRun is in the past Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
18 lines
376 B
Bash
18 lines
376 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
echo "Running Prisma migrations..."
|
|
node ./node_modules/prisma/build/index.js migrate deploy
|
|
|
|
# Background scheduler: call /api/cron/agents every 5 minutes
|
|
(
|
|
sleep 60
|
|
while true; do
|
|
wget -q -O /dev/null --post-data='' "http://localhost:3000/api/cron/agents" 2>/dev/null || true
|
|
sleep 300
|
|
done
|
|
) &
|
|
|
|
echo "Starting server..."
|
|
exec node server.js
|