mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-15 14:32:30 +01:00
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)
This commit is contained in:
parent
eed7c5b89e
commit
d7d42387f5
2 changed files with 3 additions and 1 deletions
1
changelog.d/7290.misc
Normal file
1
changelog.d/7290.misc
Normal file
|
@ -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…
Reference in a new issue