Changeset 735 for trunk/Modules/Scheduler/Scheduler.php
- Timestamp:
- Apr 6, 2015, 1:03:33 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Scheduler/Scheduler.php
r730 r735 64 64 $DbResult = $this->Database->query('SELECT `Scheduler`.*, `SchedulerAction`.`Class` AS `Class` FROM `Scheduler` '. 65 65 'LEFT JOIN `SchedulerAction` ON `SchedulerAction`.`Id` = `Scheduler`.`Action` '. 66 'WHERE (`Scheduler`.`Enabled`=1) AND (`Scheduler`.`ScheduledTime` > `Scheduler`.`LastExecutedTime`)'); 66 'WHERE (`Scheduler`.`Enabled`=1) AND (((`Scheduler`.`ScheduledTime` < "'.TimeToMysqlDateTime(time()).'") AND '. 67 ' (`Scheduler`.`LastExecutedTime` < `Scheduler`.`ScheduledTime`)) OR '. 68 '(`Scheduler`.`ScheduledTime` IS NULL))'); 67 69 while($DbRow = $DbResult->fetch_assoc()) 68 70 { … … 76 78 $this->Database->update('Scheduler', 'Id='.$DbRow['Id'], 77 79 array('Log' => $Output, 'LastExecutedTime' => 'NOW()')); 80 if($DbRow['ScheduledTime'] == '') $NewScheduledTime = time() + $DbRow['Period']; 81 else $NewScheduledTime = MysqlDateTimeToTime($DbRow['ScheduledTime']) + $DbRow['Period']; 78 82 if($DbRow['Period'] != '') $this->Database->update('Scheduler', 'Id='.$DbRow['Id'], 79 array('ScheduledTime' => TimeToMysqlDateTime( (MysqlDateTimeToTime($DbRow['ScheduledTime']) + $DbRow['Period']))));83 array('ScheduledTime' => TimeToMysqlDateTime($NewScheduledTime))); 80 84 } 81 85 echo('.');
Note:
See TracChangeset
for help on using the changeset viewer.