Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsync/discovery.cpp')
-rw-r--r--src/libsync/discovery.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp
index 5faaa11ad..00494ee52 100644
--- a/src/libsync/discovery.cpp
+++ b/src/libsync/discovery.cpp
@@ -398,11 +398,15 @@ void ProcessDirectoryJob::processFile(PathTuple path,
if(serverEntry.locked == SyncFileItem::LockStatus::LockedItem) {
const auto lockExpirationTime = serverEntry.lockTime + serverEntry.lockTimeout;
const auto timeRemaining = QDateTime::currentDateTime().secsTo(QDateTime::fromSecsSinceEpoch(lockExpirationTime));
- const auto timerInterval = qMax(5LL, timeRemaining);
+ // Add on a second as a precaution, sometimes we catch the server before it has had a chance to update
+ const auto lockExpirationTimeout = qMax(5LL, timeRemaining + 1);
+
+ qCInfo(lcDisco) << "File:" << path._original << "is locked."
+ << "Lock expires in:" << lockExpirationTimeout << "seconds."
+ << "A sync run will be scheduled for around that time.";
- qCInfo(lcDisco) << "Will re-check lock status for:" << path._original << "in:" << timerInterval << "seconds.";
_discoveryData->_anotherSyncNeeded = true;
- _discoveryData->_scheduleSyncInSecs = timerInterval;
+ _discoveryData->_filesNeedingScheduledSync.insert(path._original, lockExpirationTimeout);
}
// VFS suffixed files on the server are ignored