File tree Expand file tree Collapse file tree
lhc_web/modules/lhcron/stats Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ public static function departmentStats($regenerate = false) {
4444 $ lastUpdateTime = isset ($ configuration ['last_update_time ' ]) ? (int )$ configuration ['last_update_time ' ] : 0 ;
4545 $ now = time ();
4646
47- // Prevent multiple updates within same interval window
48- if ($ regenerate === true || $ now - $ lastUpdateTime >= $ updateInterval ) {
47+ // Prevent multiple updates within same interval window (allow 30 seconds variation)
48+ if ($ regenerate === true || $ now - $ lastUpdateTime >= $ updateInterval - 30 ) {
4949 $ updateStartedAt = microtime (true );
5050 echo "Collecting performance stats at " . date ('Y-m-d H:i:s ' ) . "\n" ;
5151
@@ -289,8 +289,8 @@ public static function operatorsStats($regenerate = false) {
289289 $ lastUpdateTime = isset ($ configuration ['last_update_time ' ]) ? (int )$ configuration ['last_update_time ' ] : 0 ;
290290 $ now = time ();
291291
292- // Prevent multiple updates within same interval window
293- if ($ regenerate === true || $ now - $ lastUpdateTime >= $ updateInterval ) {
292+ // Prevent multiple updates within same interval window (allow 30 seconds variation)
293+ if ($ regenerate === true || $ now - $ lastUpdateTime >= $ updateInterval - 30 ) {
294294 $ updateStartedAt = microtime (true );
295295 echo "Collecting performance stats at " . date ('Y-m-d H:i:s ' ) . "\n" ;
296296
You can’t perform that action at this time.
0 commit comments