diff --git a/operetta.js b/operetta.js index b4dc491..c3776dc 100644 --- a/operetta.js +++ b/operetta.js @@ -156,10 +156,7 @@ Syncer.runFetch = function*(what, params, boxId, processor) function checkFinish() { if (self.parsed <= 0 && wait) - { - wait = false; cb(); - } } }; @@ -244,7 +241,7 @@ Syncer.updateFlags = function*(messages, boxId) flags: toPgArray(m[0].flags) })); // TODO check if something is missing - pg.update('messages m', { flags: pg.sql('t.flags::varchar(255)[]') }) + yield pg.update('messages m', { flags: pg.sql('t.flags::varchar(255)[]') }) .from('('+pg.sql.values(rows)+') AS t (uid, flags)') .where({ 'm.folder_id': boxId }).where(pg.sql('m.uid=t.uid')).run(gen.ef()); self.synced += messages.length;