Changeset 873 for trunk/Modules/Scheduler/Scheduler.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Scheduler/Scheduler.php
r830 r873 61 61 function Run($Parameters) 62 62 { 63 while (true)63 while (true) 64 64 { 65 65 $DbResult = $this->Database->query('SELECT `Scheduler`.*, `SchedulerAction`.`Class` AS `Class` FROM `Scheduler` '. … … 68 68 '(`Scheduler`.`ScheduledTime` < "'.TimeToMysqlDateTime(time()).'") OR '. 69 69 '(`Scheduler`.`ScheduledTime` IS NULL))'); 70 while ($DbRow = $DbResult->fetch_assoc())70 while ($DbRow = $DbResult->fetch_assoc()) 71 71 { 72 72 echo('Executing '.$DbRow['Name']."\n"); 73 73 $Output = ''; 74 74 $StartTime = time(); 75 if (class_exists($DbRow['Class']))75 if (class_exists($DbRow['Class'])) 76 76 { 77 77 $Class = new $DbRow['Class']($this->System); … … 88 88 array('Log' => $Output, 'LastExecutedTime' => TimeToMysqlDateTime($StartTime), 89 89 'Duration' => $Duration)); 90 if ($DbRow['Period'] != '') {91 if ($DbRow['ScheduledTime'] == '') $NewScheduledTime = $StartTime + $DbRow['Period'];90 if ($DbRow['Period'] != '') { 91 if ($DbRow['ScheduledTime'] == '') $NewScheduledTime = $StartTime + $DbRow['Period']; 92 92 else $NewScheduledTime = MysqlDateTimeToTime($DbRow['ScheduledTime']) + $DbRow['Period']; 93 if ($NewScheduledTime < $StopTime) $NewScheduledTime = $StopTime + $DbRow['Period'];93 if ($NewScheduledTime < $StopTime) $NewScheduledTime = $StopTime + $DbRow['Period']; 94 94 $this->Database->update('Scheduler', 'Id='.$DbRow['Id'], 95 95 array('ScheduledTime' => TimeToMysqlDateTime($NewScheduledTime))); … … 115 115 { 116 116 $Output = '#'; 117 return ($Output);117 return ($Output); 118 118 } 119 119 }
Note:
See TracChangeset
for help on using the changeset viewer.