File tree Expand file tree Collapse file tree
packages/server/src/routes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -327,8 +327,10 @@ export function createSchedulesRouter(scheduler: Scheduler) {
327327
328328 // Update alarm if next_run_at changed or status toggled.
329329 if ( updates . next_run_at !== undefined || data . status !== undefined ) {
330- if ( updates . next_run_at ) {
331- scheduler . setAlarm ( c . req . param ( "id" ) , updates . next_run_at as string ) ;
330+ const effectiveNextRunAt =
331+ updates . next_run_at !== undefined ? updates . next_run_at : existing . next_run_at ;
332+ if ( effectiveNextRunAt ) {
333+ scheduler . setAlarm ( c . req . param ( "id" ) , effectiveNextRunAt as string ) ;
332334 } else {
333335 scheduler . cancelAlarm ( c . req . param ( "id" ) ) ;
334336 }
Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ Save the `api_key` from the response (starts with `ac_`). It cannot be retrieved
2323
2424** One-time schedule (webhook delivery):**
2525``` typescript
26- import { RelayCron } from " @relaycron/sdk" ;
26+ import { AgentCron } from " @relaycron/sdk" ;
2727
28- const cron = new RelayCron ({ apiKey: " ac_..." });
28+ const cron = new AgentCron ({ apiKey: " ac_..." });
2929
3030await cron .createSchedule ({
3131 name: " deploy-reminder" ,
@@ -66,7 +66,7 @@ await cron.createSchedule({
6666Instead of setting up a webhook endpoint, connect via WebSocket to receive payloads in real-time:
6767
6868``` typescript
69- const cron = new RelayCron ({ apiKey: " ac_..." });
69+ const cron = new AgentCron ({ apiKey: " ac_..." });
7070
7171// Create a schedule with websocket transport
7272await cron .createSchedule ({
@@ -208,7 +208,7 @@ Standard 5-field cron: `minute hour day-of-month month day-of-week`
208208### SDK Methods
209209
210210``` typescript
211- const cron = new RelayCron ({ apiKey: " ac_..." });
211+ const cron = new AgentCron ({ apiKey: " ac_..." });
212212
213213// Schedules
214214await cron .createSchedule ({... });
You can’t perform that action at this time.
0 commit comments