Ignore:
Timestamp:
Oct 4, 2019, 8:00:01 PM (5 years ago)
Author:
chronos
Message:
  • Fixed: Optimized speed of interface up-down records duration update.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigRouterOS/Generators/NetwatchImport.php

    r862 r863  
    6969
    7070    // Update Duration for new items
    71     $this->Database->query('UPDATE NetworkInterfaceUpDown AS T1, NetworkInterfaceUpDown AS T2 SET T1.Duration = TIMESTAMPDIFF(SECOND, T1.Time, T2.Time) WHERE (T2.Previous = T1.Id) AND (T2.Interface = T1.Interface) AND (T1.Duration IS NULL)');
     71    echo("Update Duration\n");
     72    $this->Database->query('UPDATE NetworkInterfaceUpDown AS T1, NetworkInterfaceUpDown AS T2 '.
     73      'SET T1.Duration = TIMESTAMPDIFF(SECOND, T1.Time, T2.Time) '.
     74      'WHERE (T2.Previous = T1.Id) AND (T2.Interface = T1.Interface) AND (T1.Duration IS NULL) AND (T2.Time = "'.TimeToMysqlDateTime($StartTime).'")');
     75    echo("done\n");
    7276
    7377    // Set offline all interfaces which were not updated as online
Note: See TracChangeset for help on using the changeset viewer.