From da586963a134df4dbac1db2df0871f93c23f7537 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 14 Sep 2023 18:27:18 +0200 Subject: [PATCH] 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 --- src/libsync/discovery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 84578612ce244..593f1f67517ff 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -616,7 +616,7 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo( } // 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