test db integrity before upload

This commit is contained in:
Damien Elmes 2011-12-08 01:06:33 +09:00
parent 0ef3fe5d75
commit 08660f6bf8

View file

@ -532,6 +532,9 @@ class FullSyncer(HttpSyncer):
def upload(self):
runHook("sync", "upload")
# make sure it's ok before we try to upload
assert self.col.db.scalar("pragma integrity_check") == "ok"
# apply some adjustments, then upload
self.col.beforeUpload()
assert self.req("upload", open(self.col.path, "rb")) == "OK"