[Pkg-owncloud-commits] [owncloud-client] 303/470: Merge pull request #4656 from owncloud/close_journal_fix
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:25:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 6cb94e88492884854500d35012470147597e194b
Merge: bd3a079 d433c24
Author: Klaas Freitag <freitag at owncloud.com>
Date: Mon Apr 11 16:14:17 2016 +0200
Merge pull request #4656 from owncloud/close_journal_fix
Close journal fix - do not keep the journal open or reopen on error.
src/libsync/owncloudpropagator.cpp | 12 +++++++-----
src/libsync/propagateremotemove.cpp | 16 +++++++++++-----
src/libsync/propagatorjobs.cpp | 6 ++++--
src/libsync/syncengine.cpp | 3 ++-
src/libsync/syncjournaldb.cpp | 9 +++++++--
src/libsync/syncjournaldb.h | 5 ++++-
6 files changed, 35 insertions(+), 16 deletions(-)
diff --cc src/libsync/propagateremotemove.cpp
index 0f43683,98f4e7e..7e49dfb
--- a/src/libsync/propagateremotemove.cpp
+++ b/src/libsync/propagateremotemove.cpp
@@@ -158,17 -162,16 +162,19 @@@ void PropagateRemoteMove::finalize(
SyncJournalFileRecord record(*_item, _propagator->getFilePath(_item->_renameTarget));
record._path = _item->_renameTarget;
- record._contentChecksum = oldRecord._contentChecksum;
- record._contentChecksumType = oldRecord._contentChecksumType;
- if (record._fileSize != oldRecord._fileSize) {
- qDebug() << "Warning: file sizes differ on server vs csync_journal: " << record._fileSize << oldRecord._fileSize;
- record._fileSize = oldRecord._fileSize; // server might have claimed different size, we take the old one from the DB
+ if (oldRecord.isValid()) {
+ record._contentChecksum = oldRecord._contentChecksum;
+ record._contentChecksumType = oldRecord._contentChecksumType;
+ if (record._fileSize != oldRecord._fileSize) {
+ qDebug() << "Warning: file sizes differ on server vs csync_journal: " << record._fileSize << oldRecord._fileSize;
+ record._fileSize = oldRecord._fileSize; // server might have claimed different size, we take the old one from the DB
+ }
}
- _propagator->_journal->setFileRecord(record);
+ if (!_propagator->_journal->setFileRecord(record)) {
+ done(SyncFileItem::FatalError, tr("Error writing metadata to the database"));
+ return;
+ }
_propagator->_journal->commit("Remote Rename");
done(SyncFileItem::Success);
}
diff --cc src/libsync/propagatorjobs.cpp
index ac11742,f137fb6..473db34
--- a/src/libsync/propagatorjobs.cpp
+++ b/src/libsync/propagatorjobs.cpp
@@@ -235,14 -232,13 +235,16 @@@ void PropagateLocalRename::start(
SyncJournalFileRecord record(*_item, targetFile);
record._path = _item->_renameTarget;
- record._contentChecksum = oldRecord._contentChecksum;
- record._contentChecksumType = oldRecord._contentChecksumType;
+ if (oldRecord.isValid()) {
+ record._contentChecksum = oldRecord._contentChecksum;
+ record._contentChecksumType = oldRecord._contentChecksumType;
+ }
if (!_item->_isDirectory) { // Directories are saved at the end
- _propagator->_journal->setFileRecord(record);
+ if (!_propagator->_journal->setFileRecord(record)) {
+ done(SyncFileItem::FatalError, tr("Error writing metadata to the database"));
+ return;
+ }
}
_propagator->_journal->commit("localRename");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list