Remember to upload files that are locked during a sync run (#4865)
authorckamm <mail@ckamm.de>
Mon, 23 May 2016 07:03:03 +0000 (09:03 +0200)
committerMarkus Goetz <markus@woboq.com>
Mon, 23 May 2016 07:03:03 +0000 (09:03 +0200)
See owncloud/enterprise#1342

src/libsync/propagateupload.cpp

index 9f983311129698d4ad6638160a83fe92489a8415..2ef53dd6becf8859c514ab276b1a293b4138d8d3 100644 (file)
@@ -546,8 +546,16 @@ void PropagateUploadFileQNAM::startNextChunk()
                 _transmissionChecksumType, _transmissionChecksum);
     }
 
-    if (! device->prepareAndOpen(_propagator->getFilePath(_item->_file), chunkStart, currentChunkSize)) {
+    const QString fileName = _propagator->getFilePath(_item->_file);
+    if (! device->prepareAndOpen(fileName, chunkStart, currentChunkSize)) {
         qDebug() << "ERR: Could not prepare upload device: " << device->errorString();
+
+        // If the file is currently locked, we want to retry the sync
+        // when it becomes available again.
+        if (FileSystem::isFileLocked(fileName)) {
+            emit _propagator->seenLockedFile(fileName);
+        }
+
         // Soft error because this is likely caused by the user modifying his files while syncing
         abortWithError( SyncFileItem::SoftError, device->errorString() );
         delete device;