Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
PHP Development

Work That Happens Without Anyone Asking

Last updated:

Silent failure is the norm

A scheduled task that stops running produces no error anywhere. The report is not sent, the sync does not happen, and nobody notices until someone asks why a number looks wrong.

Alert on completion, not just on failure. A job that never started looks identical to a job with nothing to do, and only a completion alert distinguishes them.

What every scheduled task needs

  1. Idempotency — running twice must not double the effect
  2. Overlap protection — a slow run must not be joined by the next one
  3. Logging of start, finish and what was processed
  4. A completion signal that is monitored
  5. A time limit, so a stuck job does not run forever

Use the framework's scheduler

Modern frameworks provide a scheduler defined in code, driven by a single system cron entry. That keeps the schedule in version control and visible to developers.

A dozen separate crontab entries edited on the server is the alternative, and it is invariably out of date and undocumented.

Design for restartability

  • Process in batches with progress recorded
  • A restarted job should resume, not restart from the beginning
  • Failures on one record should not stop the run
  • Failed records quarantined with the reason

A nightly job that fails at ninety per cent and has to start again from nothing will eventually fail to complete at all.

Watch the clock

IssueGuard
Daylight saving changesSchedule in UTC
Jobs overlappingLocking
Jobs running longer over timeDuration monitoring
Several heavy jobs at onceStagger the schedule
Month-end volume spikesTest at realistic volume

Frequently asked questions

How do we know a scheduled job ran?

A completion record that is monitored, with an alert if it does not appear within the expected window.

What if a job takes longer than its interval?

Locking prevents overlap. Also investigate why — growing duration usually means growing data with an unindexed query.

Should scheduled work go through the queue?

Frequently a good pattern — the scheduler enqueues work and workers process it. That gives you retries and observability for free.

What about time zones?

Schedule in UTC and convert for display. Scheduling in local time causes duplicate or missed runs twice a year.

Keep reading

Overnight job that might not have run?

If you cannot tell without checking manually, that is the problem. Completion alerting is a small fix.

Book a free 30-minute call Get a project estimate WhatsApp us

Related services

What we build for problems like this one

Web DevelopmentCustom Software Development