@convex-dev/crons
Version:
Convex component for scheduling periodic jobs.
21 lines • 844 B
JavaScript
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";
export default defineSchema({
// User space crons.
crons: defineTable({
name: v.optional(v.string()),
functionHandle: v.string(),
args: v.record(v.string(), v.any()),
schedule: v.union(v.object({
kind: v.literal("interval"),
ms: v.float64(), // milliseconds
}), v.object({
kind: v.literal("cron"),
cronspec: v.string(),
tz: v.optional(v.string()), // optional timezone, e.g. "America/New_York"
})),
schedulerJobId: v.optional(v.id("_scheduled_functions")),
executionJobId: v.optional(v.id("_scheduled_functions")), // async job to run the function
}).index("name", ["name"]),
});
//# sourceMappingURL=schema.js.map