last_synced is now updated after sync is completed

This commit is contained in:
azivner
2017-10-26 19:22:21 -04:00
parent 18d23af01a
commit f6033705a7
2 changed files with 7 additions and 3 deletions
+5 -3
View File
@@ -29,7 +29,7 @@ async function sync() {
});
try {
sql.beginTransaction();
await sql.beginTransaction();
for (const treeItem of resp.tree) {
delete treeItem['id'];
@@ -73,10 +73,12 @@ async function sync() {
}
}
sql.commit();
await sql.setOption('last_synced', syncTimestamp);
await sql.commit();
}
catch (e) {
sql.rollback();
await sql.rollback();
throw e;
}