Write cron business logic as a Python class and let this app do the rest! It enables Django projects to schedule cron tasks, tracks their success / failures, manages contention (via a cache) etc. Basically takes care of all the boring work for you :-)
The check failures == min_failures would work only when there was exactly the number of min_failures failures after this was run the last time. If the failing job ran more than once every half an hour this may have caused a situation where failures > min_failures.
Coverage remained the same at 89.82% when pulling c068ec9313b82cca443e18416f0852bb39c5de01 on santtu:patch-1 into 57bd91260bb658911880813dbac06f79483ac601 on Tivix:master.
The check
failures == min_failures
would work only when there was exactly the number ofmin_failures
failures after this was run the last time. If the failing job ran more than once every half an hour this may have caused a situation wherefailures > min_failures
.