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)
code_spécifique_watcha
Richard van der Hoff 5 years ago committed by GitHub
parent eed7c5b89e
commit d7d42387f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/7290.misc
  2. 3
      synapse/replication/tcp/streams/_base.py

@ -0,0 +1 @@
Move catchup of replication streams logic to worker.

@ -148,8 +148,9 @@ def db_query_to_update_function(
updates = [(row[0], row[1:]) for row in rows]
limited = False
if len(updates) == limit:
upto_token = rows[-1][0]
upto_token = updates[-1][0]
limited = True
assert len(updates) <= limit
return updates, upto_token, limited

Loading…
Cancel
Save