Read more

Your Cronjobs should not rely on a perfect schedule

Henning Koch
August 07, 2014Software engineer at makandra GmbH

Due to network or hardware failures, it can happen that one of your cronjobs will not run at the time you specify in the schedule. Your code should be built in a way that it can be re-run at a later time (when the failure is resolved).

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show snapshot

For example, if you are synchronizing data with another service once every day, your cronjob should not only synchronize changes from the last 24 hours. If you do this and a network failure will delay the execution of your job by 5 hours, you will only synchronize changes from hour 6-29, but forget changes from hour 1-4.

Instead your cronjob should remember the last time a sync was performed successfully, and sync all the changes that happened after that.

Posted by Henning Koch to makandra dev (2014-08-07 09:35)