Skip to content

Commit

Permalink
Merge pull request #6059 from nextcloud/bugfix/nullTimeoutIsInfiniteD…
Browse files Browse the repository at this point in the history
…oNotCheckItEveryFiveSeconds

do not check every 5 seconds files with infinite timeout (= 0)
  • Loading branch information
mgallien authored Sep 14, 2023
2 parents e010391 + a17b360 commit 23236ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libsync/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 23236ce

Please sign in to comment.