Crons

作者 get-convex6ca54f6e2e75无许可证6 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Set up recurring scheduled jobs (crons) on Convex — digests, cleanups, polling, retries. TRIGGER when the user wants a recurring/scheduled task ('every day/hour', cron, periodic cleanup). Targets internal functions, idempotent handlers.

AI 生成的概览

在 Convex 上设置面向内部函数的周期性定时任务(cron),并使用幂等处理函数。

功能
该技能指导在 Convex 上创建周期性定时任务,通过在 convex/crons.ts 文件中使用 cronJobs() 进行定义。它要求按合适的时间间隔调度 internal 函数而非公开的 api.* 函数,并让处理函数保持幂等且每次运行规模较小。它还涵盖在仪表盘计划中确认任务已出现。
适用场景
当用户希望在 Convex 上实现周期性或定时任务时使用,例如每日或每小时的摘要、定期清理、轮询或重试。适用于请求中提到 cron、定期清理或“每天/每小时”式计划的场景。
运行要求
需要 Convex 项目环境;不附带脚本,仅为说明性指令。

Add scheduled jobs (crons)

Define recurring jobs in convex/crons.ts targeting internal functions, with sane intervals and idempotent handlers.

Steps

  1. Create convex/crons.ts with cronJobs().
  2. Schedule internal functions (never public api.*) at the right interval.
  3. Make handlers idempotent (safe to re-run); keep each run small.
  4. Verify the job appears in the dashboard schedule.

Rules

  • Schedule internal.* functions, never api.*.
  • Keep cron handlers small + idempotent.
  • Don't poll tight intervals for things a subscription can push.

来源与署名

来源:get-convex/convex-backend-skill位于skills/crons提交6ca54f6

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架