schedule: fire --every now by default, add run-once for cron-style triggers (#689)
Interval schedules used to wait the full interval before their first run, which made `--every 1d` feel broken for fresh schedules. Now `--every` fires immediately on creation; `--cron` keeps waiting for the next slot. `--no-run-now` and `--run-now` override the defaults, and the parser rejects redundant combos. Adds `paseo schedule run-once <id>` to manually trigger a single run without advancing cadence or recomputing completion. The new `runOnCreate` field and `schedule/run-once` RPC are additive on the WebSocket schema.
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
SchedulePauseRequestSchema,
|
||||
ScheduleResumeRequestSchema,
|
||||
ScheduleDeleteRequestSchema,
|
||||
ScheduleRunOnceRequestSchema,
|
||||
ScheduleCreateResponseSchema,
|
||||
ScheduleListResponseSchema,
|
||||
ScheduleInspectResponseSchema,
|
||||
@@ -35,6 +36,7 @@ import {
|
||||
SchedulePauseResponseSchema,
|
||||
ScheduleResumeResponseSchema,
|
||||
ScheduleDeleteResponseSchema,
|
||||
ScheduleRunOnceResponseSchema,
|
||||
} from "../server/schedule/rpc-schemas.js";
|
||||
import {
|
||||
LoopRunRequestSchema,
|
||||
@@ -1765,6 +1767,7 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
|
||||
SchedulePauseRequestSchema,
|
||||
ScheduleResumeRequestSchema,
|
||||
ScheduleDeleteRequestSchema,
|
||||
ScheduleRunOnceRequestSchema,
|
||||
LoopRunRequestSchema,
|
||||
LoopListRequestSchema,
|
||||
LoopInspectRequestSchema,
|
||||
@@ -3378,6 +3381,7 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
|
||||
SchedulePauseResponseSchema,
|
||||
ScheduleResumeResponseSchema,
|
||||
ScheduleDeleteResponseSchema,
|
||||
ScheduleRunOnceResponseSchema,
|
||||
LoopRunResponseSchema,
|
||||
LoopListResponseSchema,
|
||||
LoopInspectResponseSchema,
|
||||
@@ -3483,6 +3487,7 @@ export type ScheduleLogsResponse = z.infer<typeof ScheduleLogsResponseSchema>;
|
||||
export type SchedulePauseResponse = z.infer<typeof SchedulePauseResponseSchema>;
|
||||
export type ScheduleResumeResponse = z.infer<typeof ScheduleResumeResponseSchema>;
|
||||
export type ScheduleDeleteResponse = z.infer<typeof ScheduleDeleteResponseSchema>;
|
||||
export type ScheduleRunOnceResponse = z.infer<typeof ScheduleRunOnceResponseSchema>;
|
||||
export type LoopRunResponse = z.infer<typeof LoopRunResponseSchema>;
|
||||
export type LoopListResponse = z.infer<typeof LoopListResponseSchema>;
|
||||
export type LoopInspectResponse = z.infer<typeof LoopInspectResponseSchema>;
|
||||
@@ -3541,6 +3546,7 @@ export type ScheduleLogsRequest = z.infer<typeof ScheduleLogsRequestSchema>;
|
||||
export type SchedulePauseRequest = z.infer<typeof SchedulePauseRequestSchema>;
|
||||
export type ScheduleResumeRequest = z.infer<typeof ScheduleResumeRequestSchema>;
|
||||
export type ScheduleDeleteRequest = z.infer<typeof ScheduleDeleteRequestSchema>;
|
||||
export type ScheduleRunOnceRequest = z.infer<typeof ScheduleRunOnceRequestSchema>;
|
||||
export type LoopRunRequest = z.infer<typeof LoopRunRequestSchema>;
|
||||
export type LoopListRequest = z.infer<typeof LoopListRequestSchema>;
|
||||
export type LoopInspectRequest = z.infer<typeof LoopInspectRequestSchema>;
|
||||
|
||||
Reference in New Issue
Block a user