mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
do clock skew check on initial connect only
This commit is contained in:
parent
7f41973972
commit
1204f977e5
1 changed files with 7 additions and 5 deletions
|
@ -61,6 +61,8 @@ class Sync(QThread):
|
|||
error.data = {}
|
||||
if error.data.get('type') == 'noResponse':
|
||||
self.emit(SIGNAL("noSyncResponse"))
|
||||
elif error.data.get('type') == 'clockOff':
|
||||
pass
|
||||
else:
|
||||
error = self.getErrorMessage(error)
|
||||
self.emit(SIGNAL("showWarning"), error)
|
||||
|
@ -88,6 +90,11 @@ class Sync(QThread):
|
|||
proxy.sourcesToCheck = self.sourcesToCheck
|
||||
proxy.connect("ankiqt-" + ankiqt.appVersion)
|
||||
self.proxy = proxy
|
||||
# check clock
|
||||
timediff = abs(proxy.timestamp - time.time())
|
||||
if timediff > 300:
|
||||
self.emit(SIGNAL("syncClockOff"), timediff)
|
||||
raise SyncError(type="clockOff")
|
||||
return self.proxy
|
||||
|
||||
def syncAllDecks(self):
|
||||
|
@ -139,11 +146,6 @@ class Sync(QThread):
|
|||
self.emit(SIGNAL("noMatchingDeck"), keys, not self.onlyMerge)
|
||||
self.setStatus("")
|
||||
return
|
||||
# check clock
|
||||
timediff = abs(proxy.timestamp - time.time())
|
||||
if timediff > 300:
|
||||
self.emit(SIGNAL("syncClockOff"), timediff)
|
||||
return
|
||||
# check conflicts
|
||||
proxy.deckName = syncName
|
||||
remoteMod = proxy.modified()
|
||||
|
|
Loading…
Reference in a new issue