跳到正文
Skillpedia
API 与服务器(后端)9.5k · #12240

convex-crons

它能做什么

这个技能会设置定时任务,使其在 Convex 应用中按设定时间自动运行。适合需要定期在后台完成工作的开发者。

适用场景

  • ✓当你需要某个任务在 Convex 应用中每小时、每天或每周自动运行时。
  • ✓当你希望清理任务按计划运行,而不是手动执行时。
  • ✓当定时任务可能被运行两次,而你需要它可以安全地重复执行时。

技能链接

https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-crons/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-crons/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请让我的 Convex 应用每天晚上自动清理旧记录。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会创建一个调度文件,把每个任务指向一个只有服务器才能调用的内部函数,并让每次运行的范围都很小,可以安全地重复执行。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

<!-- GENERATED from convex-agents content/capabilities/crons.json — do not edit by hand. -->

Add scheduled jobs (crons)

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

Workflow

  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.
常见问题

外部用户可以触发这些任务吗?

不可以。技能只调度内部函数,不会调度客户端可以调用的公开函数。

我如何确认任务已经设置好?

技能会要求你检查任务是否出现在控制台的调度列表中。

为什么任务应该可以安全地重复运行?

任务可能会被重新运行,因此重复执行不应造成重复或损坏的数据。

详情

作者的原始描述

Add recurring scheduled jobs (crons) to the Convex app.

repo: openclaw/clawhub

热度

GitHub 星标
9.5k
排名
#12240
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能