From 41afbc904862f0b3fe83807f13be12fd834e0fbe Mon Sep 17 00:00:00 2001 From: Todos Date: Thu, 29 Oct 2026 22:14:27 +0800 Subject: [PATCH] feat(worker): drive hourly sweep from waker only Set `[triggers] crons = []` so the deployed Cron Trigger is actually cleared (deleting the section leaves it running), and make the deploy interlock test for a non-empty crons list instead of the section header. Checkpoint: kwgfdL9Jb-ddBC8gHsLW1 --- .github/workflows/deploy.yml | 32 ++++++++++++++++++++++++++------ CLAUDE.md | 6 +++--- README.en.md | 24 +++++++++++++----------- README.md | 24 +++++++++++++----------- worker/wrangler.toml | 7 ++++++- 5 files changed, 61 insertions(+), 32 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e6d8af9..023f23d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -88,16 +88,36 @@ jobs: secrets.WAKER_SIGNING_KEY = wakerKey; console.log("WAKER_SIGNING_KEY: configured"); } else { - console.log("WAKER_SIGNING_KEY: not configured (native cron only)"); + console.log("WAKER_SIGNING_KEY: not configured"); } - // Interlock: once wrangler.toml has no [triggers], the waker task is - // the only schedule source. Losing the key as well would silently - // stop every hourly sweep, so fail the deploy instead. + // Interlock: a waker key and a native Cron Trigger are the only two + // schedule sources. `wrangler.toml` ships `[triggers] crons = []` + // (explicitly empty, which is what clears the deployed Cron + // Trigger), so losing the key as well would silently stop every + // hourly sweep — fail the deploy instead. Only a non-empty crons + // list counts: an absent or commented-out key sends no /schedules + // update at all (Cloudflare keeps the existing trigger). const wranglerToml = fs.readFileSync("wrangler.toml", "utf8"); - if (!wakerConfigured && !/^\[triggers\]/m.test(wranglerToml)) { + const triggersHeader = wranglerToml.match(/^\[triggers\]\s*$/m); + const triggersBody = triggersHeader + ? wranglerToml + .slice(triggersHeader.index + triggersHeader[0].length) + .split(/^\[/m)[0] + : ""; + const cronsList = triggersBody.match(/^crons\s*=\s*\[([\s\S]*?)\]/m); + // A comment inside the array is not an entry: strip comments before + // deciding whether the list actually holds a cron expression. + const cronsEntries = cronsList + ? cronsList[1].replace(/#[^\n]*/g, "") + : ""; + const cronsConfigured = /[^,\s]/.test(cronsEntries); + console.log( + `native cron: ${cronsConfigured ? "configured" : "disabled"}`, + ); + if (!wakerConfigured && !cronsConfigured) { console.error( - "neither [triggers] nor WAKER_SIGNING_KEY is configured: nothing would run", + "neither a Cron Trigger (crons) nor WAKER_SIGNING_KEY is configured: nothing would run", ); process.exit(1); } diff --git a/CLAUDE.md b/CLAUDE.md index b31c242..67b52ab 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -81,21 +81,21 @@ The worker serves the frontend's static assets from `web/dist/` via the `ASSETS` `services/scheduler.ts` is the single business implementation. Both schedule entries go through `services/scheduler-tick.ts` `runSchedulerTick(env, { source, scheduledFor })`: -- **native entry**: `scheduled()` in `index.ts`, `source: "cron"`, `scheduledFor: event.scheduledTime` (awaited, not `waitUntil`); +- **native entry**: `scheduled()` in `index.ts`, `source: "cron"`, `scheduledFor: event.scheduledTime` (awaited, not `waitUntil`). Not scheduled in production any more — `worker/wrangler.toml` ships `crons = []`; it stays in code for the rollback path; - **waker entry**: `services/waker-callback.ts`, job `hourly-reminder-sweep`, `source: "waker"`, `scheduledFor: ctx.scheduledFor`; mounted at `/_waker` by `routes/waker.ts` using the verbatim SDK copy in `worker/src/waker/` (waker-client 2.0.0 — never hand-edit that directory). The guard in front of the business pass is one atomic D1 claim per UTC hour (`{prefix}scheduler_tick_claims`, `INSERT … ON CONFLICT(tick_key) DO NOTHING` + `meta.changes`), so cron and waker can never sweep the same hour twice; the SDK's own `{prefix}waker_executions` ledger dedupes executionId retries. Failure semantics: cron keeps the claim on failure (no re-run that could double-send), waker releases it and rethrows so the platform retry (same executionId) completes the hour. Claims are pruned after 7 days. Two cases go beyond the plain table: manual triggers and dead-letter replays arrive with `trigger: "manual"` and `scheduledFor` = the dispatch time, so they run the sweep **without taking the hourly slot** (the executionId ledger and KV dedupe keep them idempotent) — otherwise the console's "run now" would be swallowed by the cron claim of that hour. And when the platform aborts an execution (timeout / evicted isolate) the claim is never released, so a waker retry may take over its own orphaned claim after `WAKER_STALE_CLAIM_SECONDS` (20s, smaller than `backoffSeconds` 30) and finish the hour; a cron claim is never taken over. -Waker is optional and the **only** setting is `WAKER_SIGNING_KEY` (GitHub Secret → `wrangler deploy --secrets-file`): unset/blank/`*_PLACEHOLDER` means native cron only. The gate is `wakerSigningKey()` in `services/scheduler-tick.ts`; the receiver stays mounted and fails closed with 500 JSON `signing_key_missing`. Do not reintroduce `WAKER_MODE`/`WAKER_URL`/project tokens — the SDK's `mountWakerReceiver`, `createWakerClient*`, `syncManifest` and `resolveWakerMode` must stay uncalled. +The hourly sweep is driven by the waker job alone. `worker/wrangler.toml` keeps `[triggers]` with `crons = []` — an explicit empty array, because per Cloudflare docs removing or commenting out the `crons` key does **not** disable an existing Cron Trigger (wrangler only PUTs `/schedules` when `crons` is defined), so deleting the section would leave the old cron running. The **only** setting is `WAKER_SIGNING_KEY` (GitHub Secret → `wrangler deploy --secrets-file`): unset/blank/`*_PLACEHOLDER` means unconfigured, and `deploy.yml` then fails the deploy because no non-empty `crons` exists either. The gate is `wakerSigningKey()` in `services/scheduler-tick.ts`; the receiver stays mounted and fails closed with 500 JSON `signing_key_missing`. Do not reintroduce `WAKER_MODE`/`WAKER_URL`/project tokens — the SDK's `mountWakerReceiver`, `createWakerClient*`, `syncManifest` and `resolveWakerMode` must stay uncalled. **Cloudflare bindings**: - `DB` — D1 database - `KV` — KV namespace (used for scheduler deduplication and status) - `ASSETS` — static file serving -- Secrets: `JWT_SECRET`, `SETUP_SECRET`, and optional `WAKER_SIGNING_KEY` (empty ⇒ native cron only) +- Secrets: `JWT_SECRET`, `SETUP_SECRET`, and `WAKER_SIGNING_KEY` (required in production — the hourly sweep's only entry point; empty ⇒ `deploy.yml` fails unless `crons` is non-empty) - Env var: `TABLE_PREFIX` (three states: unset → default `enotify`, tables like `enotify_users`; custom value → verbatim with trailing `_`; explicit `""`/CI `none` → no prefix; allows shared DB with prefix isolation) ### Frontend (`web/`) diff --git a/README.en.md b/README.en.md index 12cf5bd..48c453c 100644 --- a/README.en.md +++ b/README.en.md @@ -60,7 +60,7 @@ In your repository Settings → Secrets and variables → Actions, add: | `CLOUDFLARE_API_TOKEN` | Cloudflare API Token (needs Workers and D1 permissions) | | `JWT_SECRET` | Any random 64-char string — e.g. `openssl rand -hex 32` | | `SETUP_SECRET` | Any random string — e.g. `openssl rand -hex 16` | -| `WAKER_SIGNING_KEY` | **Optional** waker callback signing key; leave unset to stay on native cron (see "Waker Scheduling") | +| `WAKER_SIGNING_KEY` | **Required** waker callback signing key — the only schedule entry for the hourly sweep (see "Waker Scheduling") | In Settings → Secrets and variables → Actions → Variables, add: @@ -186,19 +186,21 @@ CI deployment convention (`.github/workflows/deploy.yml`): a GitHub Variables `T | `JWT_SECRET` | JWT signing secret, any random 64-char string | | `SETUP_SECRET` | Database initialization route secret, any random string | | `TABLE_PREFIX` | Table prefix, three states: unset → default `enotify` (tables like `enotify_users`); explicit empty string / CI `none` → no prefix; custom value → verbatim with trailing `_` | -| `WAKER_SIGNING_KEY` | Optional. Waker callback signing key; missing / blank / `*_PLACEHOLDER` means unconfigured → native cron only | +| `WAKER_SIGNING_KEY` | **Required.** Waker callback signing key (the only schedule entry for the hourly sweep); missing / blank / `*_PLACEHOLDER` means unconfigured, and the CI interlock then fails the deploy | -## Waker Scheduling (optional) +## Waker Scheduling -By default the hourly reminder sweep runs on the native Cloudflare Cron Trigger (`[triggers]` in `worker/wrangler.toml`, `0 * * * *` UTC). It can also be driven by the [waker](https://github.com/WorkerHub/waker) platform: **the only setting is `WAKER_SIGNING_KEY`** — leave it unset and the default cron keeps running; set it and both entries coexist, arbitrated by an hourly claim, so nothing is sent twice. +The hourly reminder sweep is driven by the `hourly-reminder-sweep` job on the [waker](https://github.com/WorkerHub/waker) platform, and **the only setting is `WAKER_SIGNING_KEY`**. `worker/wrangler.toml` has no native Cron Trigger (`[triggers]` stays with `crons = []`), so Cloudflare runs no cron and the cron slot is free; without this key nothing would run at the top of the hour, so the CI interlock fails the deploy when it is missing. + +> Why `crons = []` instead of deleting the `[triggers]` section: per the [Cloudflare docs](https://developers.cloudflare.com/workers/wrangler/configuration/#triggers), commenting out or removing the `crons` key does **not** disable an existing Cron Trigger — only an explicit empty array does (wrangler only PUTs `/schedules` when `crons` is defined). > Signature verification, the timestamp window and executionId idempotency come from the official SDK source copy (`worker/src/waker/`, `@workerhub/waker-client` 2.0.0). That directory must not be edited by hand. -### 1. Configure the signing key (optional) +### 1. Configure the signing key (required) Add the GitHub Secret `WAKER_SIGNING_KEY` (value = the signing key the waker console shows **once** when the project is created; keep a copy in your password manager first). At deploy time it is only written to `$RUNNER_TEMP/secrets.json` (0600) and uploaded via `wrangler deploy --secrets-file`; CI logs only `configured` / `not configured`, **never the value**. -Empty, whitespace-only, `undefined` and `*_PLACEHOLDER` values are all treated as "not configured". In that state the receiver is still mounted but fails closed: a real callback gets **500 JSON `signing_key_missing`**, a request without signature headers gets 400, and `GET /_waker/execute` gets 404 — it **never falls through to the SPA's 200 HTML**, never queries the DB, writes the ledger or runs business code. Deploying without the key always succeeds. +Empty, whitespace-only, `undefined` and `*_PLACEHOLDER` values are all treated as "not configured". In that state the receiver is still mounted but fails closed: a real callback gets **500 JSON `signing_key_missing`**, a request without signature headers gets 400, and `GET /_waker/execute` gets 404 — it **never falls through to the SPA's 200 HTML**, never queries the DB, writes the ledger or runs business code. With no key and an empty `crons`, the CI interlock fails the deploy instead (otherwise nothing would run at the top of the hour); a local `pnpm deploy` bypasses that interlock, so confirm the secret is set before deploying. ### 2. Create the job in the waker console @@ -223,13 +225,13 @@ There is no registration client, project token, dynamic registration/cancellatio ### 3. Database migration -`schema_v3` adds two tables under the configured table prefix (default `enotify_waker_executions`, `enotify_scheduler_tick_claims`): the SDK's executionId idempotency ledger and the hourly claim table. After upgrading, call `POST /api/setup` once (or use "check and upgrade database" in the admin UI); migrations are additive and re-runnable. If the key is configured while the claim table does not exist yet, **both** entries stop safely (no double-send wins), so migrate before configuring the key. +`schema_v3` adds two tables under the configured table prefix (default `enotify_waker_executions`, `enotify_scheduler_tick_claims`): the SDK's executionId idempotency ledger and the hourly claim table. After upgrading, call `POST /api/setup` once (or use "check and upgrade database" in the admin UI); migrations are additive and re-runnable. If the key is configured while the claim table does not exist yet, the waker entry stops safely (the claim runs before any send, so no double-send wins), so migrate before configuring the key. -### 4. Dual run, cutover and disabling +### 4. Current state, rollback and disabling -- **Dual run**: while `[triggers]` stays, both entries exist. Each UTC hour exactly one of them wins the D1 claim and runs the sweep; the other one skips (the waker side answers `duplicate_tick`), so no notification or renewal happens twice. Claim rows are kept for 7 days for troubleshooting. -- **Cut over to waker only**: first confirm exactly one claim row per hour (`SELECT tick_key, source, claimed_at FROM enotify_scheduler_tick_claims ORDER BY claimed_at DESC LIMIT 6`), then delete `[triggers]` from `worker/wrangler.toml` and deploy. CI interlocks: deploying with no `[triggers]` and no `WAKER_SIGNING_KEY` fails outright (otherwise nothing would run at the top of the hour). -- **Disable callbacks**: `wrangler deploy --secrets-file` is additive (omitting a key does not delete the old value). Restore `[triggers]`, deploy, and explicitly run `npx wrangler secret delete WAKER_SIGNING_KEY`. Even if you forget, the hourly claim still prevents duplicate runs. +- **Current state: waker only**: `worker/wrangler.toml` keeps `[triggers]` but with `crons = []` (an explicit empty array is what actually clears the Cron Trigger on Cloudflare's side), so the hourly sweep is driven by the waker job `hourly-reminder-sweep` alone. +- **Roll back to dual run / cron only**: set `crons` back to `["0 * * * *"]` in `worker/wrangler.toml` and deploy. While both entries exist, each UTC hour exactly one of them wins the D1 claim and runs the sweep; the other one skips (the waker side answers `duplicate_tick`), so no notification or renewal happens twice. Claim rows are kept for 7 days for troubleshooting. +- **Disable callbacks**: `wrangler deploy --secrets-file` is additive (omitting a key does not delete the old value). Restore `crons = ["0 * * * *"]` and deploy first, then explicitly run `npx wrangler secret delete WAKER_SIGNING_KEY`. Even if you forget, the hourly claim still prevents duplicate runs. - **Rotate the key**: rotate in the waker console → the old key stops working immediately → update the GitHub Secret `WAKER_SIGNING_KEY` → redeploy. Callbacks during the window are rejected (401) and retried by the platform. - **Manual trigger / dead-letter replay**: the platform sends the **dispatch time** for these runs, not a nominal slot (waker `manualTrigger` / `replayDeadLetter`), so they run the sweep **without taking the hourly claim**; the executionId ledger and the sweep's own KV dedupe keep them from sending anything twice. The console's "run now" therefore really runs (response `trigger: "manual"`, `executed: true` in the execution log) instead of being swallowed by the cron claim of that hour. - **Timeout / crash**: when the platform aborts a request after `timeoutSeconds` there is no chance to release the claim. A retry (same executionId) takes over the SDK ledger row and the `source=waker` hourly claim after 20 seconds and finishes the hour; a cron claim is **never** taken over (cron has no retry, and re-running would send twice). diff --git a/README.md b/README.md index 8dd26e5..2b78c89 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ npx wrangler kv namespace create ENOTIFY_KV | `CLOUDFLARE_API_TOKEN` | Cloudflare API Token(需 Workers 和 D1 权限) | | `JWT_SECRET` | 任意 64 位随机字符串,例如 `openssl rand -hex 32` | | `SETUP_SECRET` | 任意随机字符串,例如 `openssl rand -hex 16` | -| `WAKER_SIGNING_KEY` | **可选**,waker 回调验签密钥;不配则只用原生 cron(见「定时调度与 waker」) | +| `WAKER_SIGNING_KEY` | **必需**,waker 回调验签密钥——整点扫描的唯一调度入口(见「定时调度与 waker」) | 在 Settings → Secrets and variables → Actions → Variables 中添加: @@ -191,19 +191,21 @@ CI 部署约定(`.github/workflows/deploy.yml`):GitHub Variables 中的 `T | `JWT_SECRET` | JWT 签名密钥,任意 64 位随机字符串 | | `SETUP_SECRET` | 数据库初始化路由密钥,任意随机字符串 | | `TABLE_PREFIX` | 数据库表前缀,三态:未设置 → 默认 `enotify`(表名如 `enotify_users`);显式空串/CI `none` → 无前缀;自定义值 → 原样补尾 `_` | -| `WAKER_SIGNING_KEY` | 可选。waker 回调验签密钥;缺失/空白/`*_PLACEHOLDER` = 未配置,只走原生 cron | +| `WAKER_SIGNING_KEY` | **必需**。waker 回调验签密钥(整点扫描的唯一调度入口);缺失/空白/`*_PLACEHOLDER` = 未配置,CI 互锁会拦住部署 | -## 定时调度与 waker(可选) +## 定时调度与 waker -默认用 Cloudflare 原生 Cron Trigger(`worker/wrangler.toml` 的 `[triggers]`,`0 * * * *` UTC)跑每小时提醒扫描。也可以改由 [waker](https://github.com/WorkerHub/waker) 平台调度:**唯一需要配置的只有 `WAKER_SIGNING_KEY`**——不配就走默认 cron,配了则两个入口并存、按整点认领互斥,不会重复推送。 +每小时提醒扫描由 [waker](https://github.com/WorkerHub/waker) 平台的 `hourly-reminder-sweep` 任务驱动,**唯一需要配置的只有 `WAKER_SIGNING_KEY`**。`worker/wrangler.toml` 里没有原生 Cron Trigger(`[triggers]` 保留、`crons = []`),Cloudflare 侧没有 cron、槽位已释放;没有这个 key 整点就没有任何调度入口,所以 CI 互锁会在缺 key 时直接让部署失败。 + +> 为什么是 `crons = []` 而不是删掉 `[triggers]` 段:按 [Cloudflare 文档](https://developers.cloudflare.com/workers/wrangler/configuration/#triggers),注释或删除 `crons` 键**不会**停用已存在的 Cron Trigger,只有显式写空数组才会清掉它(wrangler 仅在 `crons` 有定义时才 PUT `/schedules`)。 > 回调的验签、时间窗与 executionId 幂等由官方 SDK 源码拷贝(`worker/src/waker/`,`@workerhub/waker-client` 2.0.0)负责,本仓不自己实现协议;该目录不得手改。 -### 1. 配置签名密钥(可选) +### 1. 配置签名密钥(必需) 在仓库 Settings → Secrets and variables → Actions 增加 Secret `WAKER_SIGNING_KEY`(值 = waker 控制台建项目时**一次性展示**的 signing key,先在密码管理器留底)。部署时它只写入 `$RUNNER_TEMP/secrets.json`(0600)再经 `wrangler deploy --secrets-file` 上传;CI 只打印 `configured` / `not configured` 状态,**永不打印值**。 -空值、纯空白、`undefined` 与以 `_PLACEHOLDER` 结尾的值一律视为「未配置」。未配置时 receiver 仍然挂载、但 fail closed:真回调返回 **500 JSON `signing_key_missing`**,缺签名头返回 400,`GET /_waker/execute` 返回 404——**绝不会落到 SPA 的 200 HTML**,也不会查库、写账本或触发业务。未配 key 的部署必然成功。 +空值、纯空白、`undefined` 与以 `_PLACEHOLDER` 结尾的值一律视为「未配置」。未配置时 receiver 仍然挂载、但 fail closed:真回调返回 **500 JSON `signing_key_missing`**,缺签名头返回 400,`GET /_waker/execute` 返回 404——**绝不会落到 SPA 的 200 HTML**,也不会查库、写账本或触发业务。此时 `[triggers]` 的 `crons` 也是空的,CI 会在部署前直接失败(防「两个调度都没了」的静默停跑);本地 `pnpm deploy` 不经过这道互锁,部署前先确认 Secret 已配置。 ### 2. 在 waker 控制台建任务 @@ -228,13 +230,13 @@ CI 部署约定(`.github/workflows/deploy.yml`):GitHub Variables 中的 `T ### 3. 数据库迁移 -`schema_v3` 在项目的表前缀下新建两张表(默认 `enotify_waker_executions`、`enotify_scheduler_tick_claims`):前者是 SDK 的 executionId 幂等账本,后者是整点认领表。升级部署后照常调一次 `POST /api/setup`(或管理面「检查并升级数据库」)即可;迁移只增不改、幂等可重跑。键已配但认领表还没建时,两个入口都会安全停跑(不重复发送优先),所以**先迁移再配 key**。 +`schema_v3` 在项目的表前缀下新建两张表(默认 `enotify_waker_executions`、`enotify_scheduler_tick_claims`):前者是 SDK 的 executionId 幂等账本,后者是整点认领表。升级部署后照常调一次 `POST /api/setup`(或管理面「检查并升级数据库」)即可;迁移只增不改、幂等可重跑。键已配但认领表还没建时,waker 入口会安全停跑(认领先于发送,不重复发送优先),所以**先迁移再配 key**。 -### 4. 双跑、切换与停用 +### 4. 当前状态、回退与停用 -- **双跑**:`[triggers]` 保留期间两个入口并存。每个 UTC 整点只有一个入口在 D1 里认领成功并真正跑扫描,另一侧直接跳过(waker 侧响应 `duplicate_tick`),所以不会重复推送/重复续期;认领行保留 7 天用于排障。 -- **切换成 waker 独占**:先确认认领表每小时恰好一行(`SELECT tick_key, source, claimed_at FROM enotify_scheduler_tick_claims ORDER BY claimed_at DESC LIMIT 6`),再删除 `worker/wrangler.toml` 的 `[triggers]` 并部署。CI 有互锁:`[triggers]` 不存在且 `WAKER_SIGNING_KEY` 为空时部署直接失败(否则整点将没有任何调度入口)。 -- **停用回调**:`wrangler deploy --secrets-file` 是增量语义(省略某个键不会删除旧值),所以要恢复 `[triggers]` 部署,并显式执行 `npx wrangler secret delete WAKER_SIGNING_KEY`。即使忘记删,整点认领也保证不会重复执行。 +- **当前状态:waker 独占**:`worker/wrangler.toml` 保留 `[triggers]` 但 `crons = []`(显式置空才真正清掉 Cloudflare 侧的 Cron Trigger),整点扫描只由 waker 任务 `hourly-reminder-sweep` 驱动。 +- **回退到双跑 / 纯 cron**:把 `worker/wrangler.toml` 的 `crons` 改回 `["0 * * * *"]` 并部署。两个入口并存时每个 UTC 整点只有一个入口在 D1 里认领成功并真正跑扫描,另一侧直接跳过(waker 侧响应 `duplicate_tick`),所以不会重复推送/重复续期;认领行保留 7 天用于排障。 +- **停用回调**:`wrangler deploy --secrets-file` 是增量语义(省略某个键不会删除旧值),所以要先恢复 `crons = ["0 * * * *"]` 再部署,并显式执行 `npx wrangler secret delete WAKER_SIGNING_KEY`。即使忘记删,整点认领也保证不会重复执行。 - **轮换 key**:在 waker 控制台轮换 → 旧 key 立即失效 → 更新 GitHub Secret `WAKER_SIGNING_KEY` → 重新部署。轮换窗口内的回调会因验签失败被拒(401),平台按策略重试。 - **手动触发 / 死信重放**:平台对这类执行下发的是「投递时刻」而不是整点槽位(waker `manualTrigger` / `replayDeadLetter`),所以它们**不占用整点认领**,直接跑一轮扫描;executionId 已由 SDK 账本去重、提醒与续期仍有 KV 去重,因此不会重复推送。控制台的「立即执行」是真实运行(响应体 `trigger: "manual"`,执行日志里 `executed: true`),不是被 cron 认领吞掉的静默 no-op。 - **超时 / 崩溃**:平台在 `timeoutSeconds` 后中断请求时没有机会释放认领,重试(同一 executionId)会在 20 秒后接管 SDK 账本占位与 `source=waker` 的整点认领,把这一小时补完;cron 的认领**永不**被接管(它没有重试,重跑会重复发送)。 diff --git a/worker/wrangler.toml b/worker/wrangler.toml index cad9255..772526b 100644 --- a/worker/wrangler.toml +++ b/worker/wrangler.toml @@ -25,7 +25,12 @@ id = "KV_NAMESPACE_ID_PLACEHOLDER" [vars] TABLE_PREFIX = "TABLE_PREFIX_PLACEHOLDER" +# No native Cron Trigger: the hourly reminder sweep is driven by the waker job +# `hourly-reminder-sweep` (see README "定时调度与 waker"). Keep the section and +# empty `crons` instead of deleting it — per Cloudflare docs, removing or +# commenting out the `crons` key does NOT disable an existing Cron Trigger; +# only `crons = []` does (wrangler only PUTs /schedules when `crons` is set). [triggers] -crons = ["0 * * * *"] +crons = []