From: Matthieu Gallien Date: Thu, 14 Sep 2023 16:27:18 +0000 (+0200) Subject: do not check every 5 seconds files with infinite timeout (= 0) X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~92^2^2~2^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d299e579e6bb9dce3302d673010bf58a7131812c;p=nextcloud-desktop.git do not check every 5 seconds files with infinite timeout (= 0) we want to schedule a new sync attempt if a file is likely to have been unlocked due to timeout expiring on server but if the timeout is null (equal to 0), there will be no timeout on server and no automated unlocking, so do not schedule a sync every 5 seconds to check for it Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index e33dda14d..669d9f5c7 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -673,7 +673,7 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(const SyncFileItemPtr &it } // We want to check the lock state of this file after the lock time has expired - if(serverEntry.locked == SyncFileItem::LockStatus::LockedItem) { + if(serverEntry.locked == SyncFileItem::LockStatus::LockedItem && serverEntry.lockTimeout > 0) { const auto lockExpirationTime = serverEntry.lockTime + serverEntry.lockTimeout; const auto timeRemaining = QDateTime::currentDateTime().secsTo(QDateTime::fromSecsSinceEpoch(lockExpirationTime)); // Add on a second as a precaution, sometimes we catch the server before it has had a chance to update