factor time diff into lastSync

This commit is contained in:
Damien Elmes 2010-12-17 03:27:02 +09:00
parent bd3d964b71
commit 3b7c6f4875

View file

@ -100,8 +100,7 @@ sync was aborted. Please report this error.""")
proxy.connect("ankiqt-" + ankiqt.appVersion) proxy.connect("ankiqt-" + ankiqt.appVersion)
self.proxy = proxy self.proxy = proxy
# check clock # check clock
timediff = abs(proxy.timestamp - time.time()) if proxy.timediff > 300:
if timediff > 300:
self.emit(SIGNAL("syncClockOff"), timediff) self.emit(SIGNAL("syncClockOff"), timediff)
raise SyncError(type="clockOff") raise SyncError(type="clockOff")
return self.proxy return self.proxy
@ -192,7 +191,7 @@ sync was aborted. Please report this error.""")
client.setServer(proxy) client.setServer(proxy)
# need to do anything? # need to do anything?
start = time.time() start = time.time()
if client.prepareSync(): if client.prepareSync(proxy.timediff):
changes = True changes = True
# summary # summary
if not self.conflictResolution and not self.onlyMerge: if not self.conflictResolution and not self.onlyMerge: