最新资讯
stackoverflow.blog 欢迎来到芯片时代:半导体制造、AI 数据中心与芯片设计的未来 www.youtube.com AI Agent 总犯同样的错:CentralAgent AI 将记忆重构为经验系统 pub.towardsai.net Netflix 科学家建议重采样 LLM 评判:5 次仅将误差棒缩小 13% pub.towardsai.net Jev 作为 LLM 前的静默层:构建提示感知的模型路由器 reddit.com OpenAI 称 Astra 仅满足 10% 安全任务标准 dev.to FreeToken:在自有 GPU 上运行前沿 MoE 模型及其内存需求 dev.to 当 AI Agent 说“完成”时,究竟完成了什么? dev.to 部署 Underdog Bark 3.0 Pro:逐字转写、自定义后端与分块设置 dev.to 为艰难对话构建 AI:五个 Agent、一条安全正则与一位盲评监督者 techcrunch.com Palo Alto Networks 洽谈以 5 亿美元收购 AI Agent 安全初创公司 Clutch theinformation.com 黄仁勋被要求就涉华间谍指控向国会作简报 www.infoq.com Edera 推出 Object Capability Bounded Authority,试图将凭证与 AI Agent 工作负载隔离
多元动态
登录 注册
智能体 developers.cloudflare.com · @Cloudflare Developers

Cloudflare Workers 本地开发支持测试 Cron Triggers

原文 我的收藏

Cloudflare 更新 Local Explorer,开发者可在本地开发时向 Worker 的 scheduled() handler 发送一次性 Cron Trigger 调用,无需构造请求 URL。通过 cf dev、wrangler dev 或 Vite 插件启动服务后,访问 /cdn-cgi/local/explorer 即可调用已配置的 cron 表达式、构建临时表达式、设置可复用调度时间并查看结果与 noRetry() 状态。临时触发和预设仅保存在浏览器,不修改配置文件或已部署的 Cron Triggers,本地开发也不会自动运行 cron 调度。Local Explorer API 提供相同操作,可供工具和 AI Agent 调用。

AI推荐理由 Cloudflare 官方 changelog 明确说明 Local Explorer 新增本地触发 Cron Trigger 的能力,可直接调用 Worker 的 scheduled() handler,并支持浏览器界面与 API 两种方式;API 面向工具和 AI Agent,属于可验证的开发工具改进。局限在于仅限本地开发、不会自动运行 cron 调度,且未提供实际使用效果或性能数据。

72

正文

Local Explorer can now send one-off Cron Trigger invocations to a Worker's `scheduled()` handler during local development. This removes the need to construct request URLs when testing handler behavior. Start your local development server with [`cf dev`](https://developers.cloudflare.com/cf/projects/#start-development), [`wrangler dev`](https://developers.cloudflare.com/workers/wrangler/commands/general/#dev), or the [Cloudflare Vite plugin](https://developers.cloudflare.com/workers/vite-plugin/). Open `/cdn-cgi/local/explorer` on the server URL and select **Cron Triggers**. The browser interface supports the following tasks: * Invoke configured cron expressions * Build ad hoc expressions * Set reusable scheduled times * Inspect outcomes and `noRetry()` status Ad hoc triggers and scheduled time presets stay in your browser. They do not change `cloudflare.config.ts`, your Wrangler configuration, or deployed Cron Triggers. Local development does not run cron schedules automatically. Full logs and traces are available in the development session that owns the Worker when that session has **Observability** turned on. The following example uses port `8787`. Replace it with your development server port, such as `5173` for Vite. The Local Explorer API exposes the same operation for tools and AI agents. The request targets an exact Worker name and accepts a cron expression and optional scheduled time: ``` curl -X POST \ "http://localhost:8787/cdn-cgi/local/explorer/api/local/scheduled?worker=my-worker" \ -H "Content-Type: application/json" \ --data '{"cron":"0 * * * *","scheduled_time":1745856238000}' ``` For more details, refer to [Test Cron Triggers with Local Explorer](https://developers.cloudflare.com/workers/local-development/local-explorer/#test-cron-triggers).

来源报道 · 1 篇 · 以下链接均前往原始媒体

Cloudflare Developers Cloudflare Workers 本地开发支持测试 Cron Triggers 10-17 · 原文发布
← 返回精选动态 原文

更多内容