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 從公開儲存庫中收錄這些內容。

檢舉或申請下架