feat: auto-trigger scheduled agents + fix stale nextRun display
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 41s
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>
This commit is contained in:
@@ -202,7 +202,9 @@ export function AgentCard({ agent, onEdit, onRefresh, onToggle }: AgentCardProps
|
||||
<Clock className="w-3 h-3" />
|
||||
{t('agents.schedule.nextRun')}{' '}
|
||||
{mounted
|
||||
? formatDistanceToNow(new Date(agent.nextRun), { addSuffix: true, locale: dateLocale })
|
||||
? new Date(agent.nextRun) > new Date()
|
||||
? formatDistanceToNow(new Date(agent.nextRun), { addSuffix: true, locale: dateLocale })
|
||||
: t('agents.schedule.pending')
|
||||
: new Date(agent.nextRun).toISOString().split('T')[0]}
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user