bump mod time on full sync to server, ensure lastSync matches

This commit is contained in:
Damien Elmes 2010-07-21 18:37:05 +09:00
parent f58651cf1b
commit 6852b0acda

View file

@ -926,7 +926,8 @@ and cards.id in %s""" % ids2str([c[0] for c in cards])))
def prepareFullSync(self):
t = time.time()
self.deck.lastSync = t
self.deck.flushMod()
self.deck.lastSync = self.deck.modified
self.deck.s.commit()
self.deck.close()
fields = {
@ -1097,6 +1098,9 @@ class HttpSyncServerProxy(SyncServer):
self.connect()
return self.decks[self.deckName][1]
def hasChanged(self, deckName):
return self.decks[deckName][0] > self.decks[deckName][1]
def applyPayload(self, payload):
return self.runCmd("applyPayload",
payload=self.stuff(payload))