From 76ccd91ff92f1e4b29286fdeda4e687937615a81 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Sat, 19 Dec 2015 09:18:48 -0800 Subject: [PATCH] Support >= 2.9 query batching Change-Id: I78e2f32d16c938153e58c1304575622351271b71 --- gertty/sync.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gertty/sync.py b/gertty/sync.py index b17bb81..caf1b7e 100644 --- a/gertty/sync.py +++ b/gertty/sync.py @@ -353,8 +353,11 @@ class SyncProjectTask(Task): for batch in responses: changes += batch if batch and '_more_changes' in batch[-1]: - sortkey = '&N=%s' % (batch[-1]['_sortkey'],) done = False + if '_sortkey' in batch[-1]: + sortkey = '&N=%s' % (batch[-1]['_sortkey'],) + else: + sortkey = '&start=%s' % (len(batch)) change_ids = [c['id'] for c in changes] with app.db.getSession() as session: # Winnow the list of IDs to only the ones in the local DB.