Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Scheduler/Scheduler.php

    r830 r873  
    6161  function Run($Parameters)
    6262  {
    63     while(true)
     63    while (true)
    6464    {
    6565      $DbResult = $this->Database->query('SELECT `Scheduler`.*, `SchedulerAction`.`Class` AS `Class` FROM `Scheduler` '.
     
    6868        '(`Scheduler`.`ScheduledTime` < "'.TimeToMysqlDateTime(time()).'") OR '.
    6969        '(`Scheduler`.`ScheduledTime` IS NULL))');
    70       while($DbRow = $DbResult->fetch_assoc())
     70      while ($DbRow = $DbResult->fetch_assoc())
    7171      {
    7272        echo('Executing '.$DbRow['Name']."\n");
    7373        $Output = '';
    7474        $StartTime = time();
    75         if(class_exists($DbRow['Class']))
     75        if (class_exists($DbRow['Class']))
    7676        {
    7777          $Class = new $DbRow['Class']($this->System);
     
    8888          array('Log' => $Output, 'LastExecutedTime' => TimeToMysqlDateTime($StartTime),
    8989            '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'];
    9292            else $NewScheduledTime = MysqlDateTimeToTime($DbRow['ScheduledTime']) + $DbRow['Period'];
    93           if($NewScheduledTime < $StopTime) $NewScheduledTime = $StopTime + $DbRow['Period'];
     93          if ($NewScheduledTime < $StopTime) $NewScheduledTime = $StopTime + $DbRow['Period'];
    9494          $this->Database->update('Scheduler', 'Id='.$DbRow['Id'],
    9595            array('ScheduledTime' => TimeToMysqlDateTime($NewScheduledTime)));
     
    115115  {
    116116    $Output = '#';
    117     return($Output);
     117    return ($Output);
    118118  }
    119119}
Note: See TracChangeset for help on using the changeset viewer.