fix(scheduled-task): enable worker by default and add WeChat preflight
Memind CI / Test, build, and release guards (push) Has been cancelled
Memind CI / Test, build, and release guards (push) Has been cancelled
Scheduled automations were saved but never executed because the worker required an explicit env flag. Follow H5_REMINDER_WORKER_ENABLED when unset, add WeChat preflight to write tasks deterministically, and surface worker warnings on create. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -572,6 +572,10 @@ MVP:
|
||||
| `H5_REMINDER_DEFAULT_MEETING_OFFSET_MINUTES` | `60` | 会议默认提前提醒分钟数 |
|
||||
| `H5_REMINDER_MAX_ATTEMPTS` | `5` | 最大投递次数 |
|
||||
| `H5_DEFAULT_TIMEZONE` | `Asia/Shanghai` | 默认用户时区 |
|
||||
| `H5_SCHEDULED_TASK_WORKER_ENABLED` | 未设置时跟随 `H5_REMINDER_WORKER_ENABLED` | 是否启动定时自动任务 worker |
|
||||
| `H5_SCHEDULED_TASK_SCAN_INTERVAL_MS` | `30000` | 定时任务 worker 扫描间隔 |
|
||||
| `H5_SCHEDULED_TASK_MAX_ATTEMPTS` | `3` | 定时任务最大执行重试次数 |
|
||||
| `H5_SCHEDULED_TASK_EXECUTION_TIMEOUT_MS` | `900000` | 单次定时任务 Agent 执行超时 |
|
||||
|
||||
部署“每天早上 7 点服务号推送待办记录”时,至少需要:
|
||||
|
||||
@@ -582,6 +586,17 @@ H5_REMINDER_WORKER_ENABLED=1
|
||||
H5_DEFAULT_TIMEZONE=Asia/Shanghai
|
||||
```
|
||||
|
||||
部署“每天 6 点自动生成新闻页并推送链接”等 **Scheduled Automation** 时,至少需要:
|
||||
|
||||
```bash
|
||||
H5_WECHAT_MP_ENABLED=1
|
||||
H5_SCHEDULE_ENABLED=1
|
||||
H5_SCHEDULED_TASK_WORKER_ENABLED=1 # 或 H5_REMINDER_WORKER_ENABLED=1(未显式设置时自动跟随)
|
||||
H5_DEFAULT_TIMEZONE=Asia/Shanghai
|
||||
```
|
||||
|
||||
微信侧对“每天 X 点做 Y”类定时自动任务会走 `wechat/handlers/scheduled-task.mjs` preflight,直接写入 `h5_scheduled_tasks`;到点由 `scheduled-task-worker.mjs` 拉起 Agent 执行并推送结果。
|
||||
|
||||
## 开发步骤
|
||||
|
||||
### P0:设计和测试骨架
|
||||
|
||||
Reference in New Issue
Block a user