Cron Background Job Failure: Why I Choose Heartbeat Detection Before Cost Attribution
An error tells a notification team where work broke; a missing heartbeat tells it that expected work never completed. I would keep both signals before assigning delivery costs to a scheduled run. Short answer: for a Node.js cron background job, capture exceptions or error logs and alert through a separate polling worker, then add an external Healthchecks-style monitor for missed runs. That gives…
In the article "Cron Background Job Failure: Why I Choose Heartbeat Detection Before Cost Attribution," the author emphasizes the importance of capturing both failure and missed completion signals for cron background jobs. They recommend using a separate polling worker to monitor for missing runs, in addition to capturing exceptions or error logs for failed jobs.
This approach allows for clear evidence of failure without treating either signal as proof of successful delivery. The author also suggests attributing delivery attempts and costs to a single run, using an application-owned identifier, and keeping unknown costs visible until sufficient evidence arrives.
Brief written by urgent.news; may contain errors — check the original.
Source: dev.to