Technical notes on web development, DevOps, and AI integration.
1 article
A crashed cron loop resent the same prompt. A send-then-poll async contract plus two state files make Qwen chat generation safe to re-execute.
TL;DR: After a cron crash resent duplicate prompts and burned quota, the author swapped queue infrastructure for two empty files as idempotency keys: one marks the prompt sent, the other the result done. A four-state exit code contract (42, 3, 0, 1) mirrors the async request-reply pattern client-side. Since cron retries crashed jobs, making re-runs harmless beats a database or broker.