From 27732e355343bb381f46b85a594de19b502ed9e3 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 25 Jun 2009 05:47:14 +0900 Subject: [PATCH] catch large # of reviews in full sync, reduce limit to 500 --- anki/sync.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/anki/sync.py b/anki/sync.py index 33163215f..bf112b65b 100644 --- a/anki/sync.py +++ b/anki/sync.py @@ -907,8 +907,17 @@ and cards.id in %s""" % ids2str([c[0] for c in cards]))) return True for sum in sums: for l in sum.values(): - if len(l) > 1000: + if len(l) > 500: return True + if self.deck.s.scalar( + "select count() from reviewHistory where time > :ls", + ls=self.deck.lastSync) > 500: + return True + lastDay = date.fromtimestamp(max(0, self.deck.lastSync - 60*60*24)) + if self.deck.s.scalar( + "select count() from stats where day >= :day", + day=lastDay) > 100: + return True return False def prepareFullSync(self):