Changeset 830


Ignore:
Timestamp:
Apr 30, 2016, 11:55:02 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Notify background job is now needed to run separately by cmd.php notify.
  • Added: Catch exception thrown from scheduler jobs.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r828 r830  
    11<?php
    22
    3 $Revision = 828; // Subversion revision
     3$Revision = 830; // Subversion revision
    44$DatabaseRevision = 824; // SQL structure revision
    5 $ReleaseTime = strtotime('2016-04-27');
     5$ReleaseTime = strtotime('2016-04-30');
  • trunk/Modules/Network/Network.php

    r829 r830  
    711711    $this->Database->query('DELETE FROM `NetworkPort` WHERE `Interface`='.$Id);
    712712    $this->Database->query('DELETE FROM `NetworkSignal` WHERE `Interface`='.$Id);
    713     $this->Database->query('DELETE FROM `NetworkInterfaceWireless` WHERE `Interface`='.$Id);
     713    $this->Database->query('DELETE FROM `NetworkInterfaceWireless` WHERE `NetworkInterface`='.$Id);
    714714  }
    715715
  • trunk/Modules/Notify/Notify.php

    r824 r830  
    66{
    77  var $Checks;
    8  
     8
    99  function __construct($System)
    1010  {
     
    3838      ),
    3939    ));
     40    $this->System->RegisterCommandLine('notify', array($this, 'RunCheck'));
    4041  }
    41  
     42
    4243  function RegisterCheck($Name, $Callback)
    4344  {
    44     if(array_key_exists($Name, $this->Checks)) 
     45    if(array_key_exists($Name, $this->Checks))
    4546      throw new Exception('Check function "'.$Name.'" already registered.');
    4647    $this->Checks[$Name] = array('Callback' => $Callback);
    4748  }
    48  
     49
    4950  function UnregisterCheck($Name)
    5051  {
    51     if(!array_key_exists($Name, $this->Checks)) 
     52    if(!array_key_exists($Name, $this->Checks))
    5253      throw new Exception('Check function "'.$Name.'" not registered.');
    5354    unset($this->Checks[$Name]);
     
    104105  }
    105106
     107  function RunCheck($Parameters)
     108  {
     109    RepeatFunction(30, array($this, 'Check'));
     110  }
     111
    106112  function DoInstall()
    107113  {
     
    142148  }
    143149}
    144 
    145 class ScheduleNotifyCheck extends SchedulerTask
    146 {
    147   function Execute()
    148   {
    149     $Output = $this->System->ModuleManager->Modules['Notify']->Check();
    150 
    151     return($Output);
    152   }
    153 }
  • trunk/Modules/Scheduler/Scheduler.php

    r799 r830  
    7676        {
    7777          $Class = new $DbRow['Class']($this->System);
    78           $Output = $Class->Execute();
     78          try {
     79            $Output = $Class->Execute();
     80          } catch (Exception $E) {
     81            echo($E->getMessage()."\n");
     82          }
    7983          echo($Output);
    8084        } else echo('Class '.$DbRow['Class'].' not found'."\n");
Note: See TracChangeset for help on using the changeset viewer.