Skip to content

Commit 6c4b28d

Browse files
committed
Allow 30 seconds window for cronjob
1 parent 2e48570 commit 6c4b28d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lhc_web/modules/lhcron/stats/performance.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)