Commit e232e4c6 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #528 in ZP/z-push from...

Merge pull request #528 in ZP/z-push from feature/ZP-1212-folder-stat-data-expiration-time to develop

* commit 'eb9b42db':
  ZP-1212 Randomize folderstat expiration time.
parents de033512 eb9b42db
...@@ -1583,6 +1583,8 @@ class Sync extends RequestProcessor { ...@@ -1583,6 +1583,8 @@ class Sync extends RequestProcessor {
$interval = Utils::GetFiltertypeInterval($spa->GetFilterType()); $interval = Utils::GetFiltertypeInterval($spa->GetFilterType());
$timeout = time() + (($interval && $interval < $maxTimeout) ? $interval : $maxTimeout); $timeout = time() + (($interval && $interval < $maxTimeout) ? $interval : $maxTimeout);
// randomize timout in 12h
$timeout -= rand(0, 43200);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("Sync()->setFolderStat() on %s: %s expiring %s", $spa->getFolderId(), $newFolderStat, date('Y-m-d H:i:s', $timeout))); ZLog::Write(LOGLEVEL_DEBUG, sprintf("Sync()->setFolderStat() on %s: %s expiring %s", $spa->getFolderId(), $newFolderStat, date('Y-m-d H:i:s', $timeout)));
$spa->SetFolderStatTimeout($timeout); $spa->SetFolderStatTimeout($timeout);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment