@@ -396,31 +396,30 @@ def on_new_event(
396396
397397 Will wake up all listeners for the given users and rooms.
398398 """
399- with PreserveLoggingContext ():
400- with Measure (self .clock , "on_new_event" ):
401- user_streams = set ()
399+ with Measure (self .clock , "on_new_event" ):
400+ user_streams = set ()
402401
403- for user in users :
404- user_stream = self .user_to_user_stream .get (str (user ))
405- if user_stream is not None :
406- user_streams .add (user_stream )
402+ for user in users :
403+ user_stream = self .user_to_user_stream .get (str (user ))
404+ if user_stream is not None :
405+ user_streams .add (user_stream )
407406
408- for room in rooms :
409- user_streams |= self .room_to_user_streams .get (room , set ())
407+ for room in rooms :
408+ user_streams |= self .room_to_user_streams .get (room , set ())
410409
411- time_now_ms = self .clock .time_msec ()
412- for user_stream in user_streams :
413- try :
414- user_stream .notify (stream_key , new_token , time_now_ms )
415- except Exception :
416- logger .exception ("Failed to notify listener" )
410+ time_now_ms = self .clock .time_msec ()
411+ for user_stream in user_streams :
412+ try :
413+ user_stream .notify (stream_key , new_token , time_now_ms )
414+ except Exception :
415+ logger .exception ("Failed to notify listener" )
417416
418- self .notify_replication ()
417+ self .notify_replication ()
419418
420- # Notify appservices
421- self ._notify_app_services_ephemeral (
422- stream_key , new_token , users ,
423- )
419+ # Notify appservices
420+ self ._notify_app_services_ephemeral (
421+ stream_key , new_token , users ,
422+ )
424423
425424 def on_new_replication_data (self ) -> None :
426425 """Used to inform replication listeners that something has happened
0 commit comments