Under construction - work in progress

Scheduler enhancement

Scheduler extension (as of TYPO3 4.5.40) is a very nice piece of software, but it has some problems with logging and executing jobs in parallel,

Execution of jobs is done one after the other, in queue, so the execution starting time is correct only for the first job in queue, with no warranty for other jobs following.

More, all logging is done using the start time of script, despite when it is executed or ended.

So, the first change we did was to logging, using the current time for any logging operation.

Second change was the introduction of forking jobs, and we spent a  lot of time until we found a bug in core for non persistent connection.

Forking means to execute more jobs in parallel, if there are, so scheduler must open a new database connection for any job forked for letting it work. But these new connections did never work, until we fixed the bug we spoke about before.

After fixing the bug in core, fork could be done easily.

We added also seconds ticking, so execution of jobs may be invoked with seconds resolution, and scheduler panel and logging have been enhanced to use seconds instead of minutes.

Mechanism of second ticking is easy. Scheduler, as usual, relies on cron, and when is it started from cron, it checks for next job time and put itself to sleep until that second, then executes the job and put itself to sleep again until the next job time, or until the end on the minute slot.

For avoiding to awake scheduler every minute, it may be awaked after longer delay, let's say 20 minutes or two hours, and a paramenter must tell it the exact cron slot.

We noted also that every cron run takes a delay, which is important when you deal with seconds and want a job to run exactly at '00' seconds. So we added a parameter for handling this cron delay, and scheduler now adapts itself in order to override this delay when the cron slot has finished (the ending scheduler run will extend its life in order to execute those jobs which could be missed by the starting scheduler).

Of course, all new features are available if enabled, including seconds logging.