Skip to content
Snippets Groups Projects
Unverified Commit d7d42387 authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

Fix 'generator object is not subscriptable' error (#7290)

Some of the query functions return generators rather than lists, so we can't
index into the result. Happily we already have a copy of the results.

(think this was introduced in #7024)
parent eed7c5b8
No related branches found
No related tags found
No related merge requests found
Move catchup of replication streams logic to worker.
...@@ -148,8 +148,9 @@ def db_query_to_update_function( ...@@ -148,8 +148,9 @@ def db_query_to_update_function(
updates = [(row[0], row[1:]) for row in rows] updates = [(row[0], row[1:]) for row in rows]
limited = False limited = False
if len(updates) == limit: if len(updates) == limit:
upto_token = rows[-1][0] upto_token = updates[-1][0]
limited = True limited = True
assert len(updates) <= limit
return updates, upto_token, limited return updates, upto_token, limited
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment