← Back to library

一次性 at 任务在重启后避免重复触发

用于‘提醒/一次性任务重启后重复执行’场景:PR #13878 通过修正重启恢复逻辑,降低 at 任务二次触发风险。

GITHUBDiscovered 2026-02-12Author lailoo
Prerequisites
  • You rely on one-shot `at` jobs for reminders or delayed actions.
  • Gateway restarts may happen during/after job execution windows.
Steps
  1. Upgrade to a build including PR #13878 and restart gateway.
  2. Create a test one-shot job (`schedule.kind=at`) scheduled a few minutes ahead.
  3. After the job fires, restart gateway and confirm run history is not duplicated.
  4. Repeat with skip/error scenarios to ensure restart does not re-fire finished jobs.
Commands
openclaw gateway status
openclaw gateway restart
openclaw help
Verify

Each one-shot reminder is delivered once even after service restart, with one corresponding run record.

Caveats
  • If external scripts also resend reminders, duplicates can still happen outside cron core.
  • Exact persistence behavior depends on your storage backend(需验证).
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post