SiT! Bugs - SiT!
View Issue Details
0001915SiT!schedulerpublic2014-02-06 14:452014-02-06 14:45
normalminorhave not tried
WindowsWindows Server2000+Later
3.67 LTS 
0001915: Condition in schedule_actions_due
I think the following line in the function schedule_actions_due()
     $sql .= "AND IF(UNIX_TIMESTAMP(laststarted) > 0, UNIX_TIMESTAMP(lastran), -1) <= IF(UNIX_TIMESTAMP(laststarted) > 0, UNIX_TIMESTAMP(laststarted), 0)";
has no sense, because ....
1 - When the job is running the condicion results in TRUE, and the job will be selected to run again,
    which is not the intention of this function ! (lastran < laststarted)
2 - When the job is not running the condicion is true: ok.
I thought to change this line to:
    $sql .= "AND IF(UNIX_TIMESTAMP(laststarted) > 0, UNIX_TIMESTAMP(laststarted), -1) <= IF(UNIX_TIMESTAMP(laststarted) > 0, UNIX_TIMESTAMP(lastran), 0)";
but this situation never exists, because the function schedule_action_done updates both fields in one sql.

I think the original intention of the programmer is to check that the job is NOT running, like this:
    $sql .= "AND laststarted = NULL";
Please inform me of the correct solutuon.
No tags attached.
Issue History
2014-02-06 14:45FransNew Issue

There are no notes attached to this issue.