mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-10-08 04:38:30 -04:00
Convert EventStreamResult to attrs. (#11574)
This commit is contained in:
parent
17886d2603
commit
323151b787
3 changed files with 24 additions and 9 deletions
|
@ -79,13 +79,14 @@ class EventStreamHandler:
|
|||
# thundering herds on restart.
|
||||
timeout = random.randint(int(timeout * 0.9), int(timeout * 1.1))
|
||||
|
||||
events, tokens = await self.notifier.get_events_for(
|
||||
stream_result = await self.notifier.get_events_for(
|
||||
auth_user,
|
||||
pagin_config,
|
||||
timeout,
|
||||
is_guest=is_guest,
|
||||
explicit_room_id=room_id,
|
||||
)
|
||||
events = stream_result.events
|
||||
|
||||
time_now = self.clock.time_msec()
|
||||
|
||||
|
@ -128,8 +129,8 @@ class EventStreamHandler:
|
|||
|
||||
chunk = {
|
||||
"chunk": chunks,
|
||||
"start": await tokens[0].to_string(self.store),
|
||||
"end": await tokens[1].to_string(self.store),
|
||||
"start": await stream_result.start_token.to_string(self.store),
|
||||
"end": await stream_result.end_token.to_string(self.store),
|
||||
}
|
||||
|
||||
return chunk
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue