mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Merge pull request #350 from nextcloud/upstream/pr/6436
SyncJournalDb::setSelectiveSyncList: Always use a transaction
This commit is contained in:
commit
3ce41c71c1
1 changed files with 4 additions and 0 deletions
|
@ -1886,6 +1886,8 @@ void SyncJournalDb::setSelectiveSyncList(SyncJournalDb::SelectiveSyncListType ty
|
|||
return;
|
||||
}
|
||||
|
||||
startTransaction();
|
||||
|
||||
//first, delete all entries of this type
|
||||
SqlQuery delQuery("DELETE FROM selectivesync WHERE type == ?1", _db);
|
||||
delQuery.bindValue(1, int(type));
|
||||
|
@ -1902,6 +1904,8 @@ void SyncJournalDb::setSelectiveSyncList(SyncJournalDb::SelectiveSyncListType ty
|
|||
qCWarning(lcDb) << "SQL error when inserting into selective sync" << type << path << delQuery.error();
|
||||
}
|
||||
}
|
||||
|
||||
commitInternal("setSelectiveSyncList");
|
||||
}
|
||||
|
||||
void SyncJournalDb::avoidRenamesOnNextSync(const QByteArray &path)
|
||||
|
|
Loading…
Reference in a new issue