Skip to content
Little GolemMake your next move.

aug 2014: -2 hours topic

Public forum discussion.

#1 · Hjallti

7 Aug 2014

The vacationdays / time-out / tournaments -daemon(s) is (are) running again.

It is an old problem and there has been some suggestions how to solve it.

For me the best seems to be that whenever a negative time is seen by the computer the daemons are triggered again.

I hope Richard tackles this problem now.

In this topic I hope some people with more knowledge will make a suggestions for solutions.

#2 · Tommah

7 Aug 2014

It would be nice if he could turn the daemon into a cron job.  So instead of running a daemon that goes "check for timeouts, sleep 15 minutes, repeat", he could just have a program that does the check, and schedule this to run every 15 minutes.

Another approach (the one I used for NataliaBot) is to have a program that does the main work, then have another "wrapper" script that calls the main script in a loop, with sleeps in between.  This way, if the main program crashes for an odd reason, it will be started again soon anyway.  I set the wrapper script to run on startup... and NataliaBot ran consistently like this (until her machine died!).

#3 · Ignatius J Reilly

7 Aug 2014

I agree with Tommah that a cron job is more robust than a process that runs indefinitely, sleeping at intervals.  And it is very simple to implement too (i.e. not much work to convert a persistent process to a periodically run cron job)