Log over appservice push path

This commit is contained in:
Will Hunt 2019-03-20 16:04:08 +00:00
parent 2ca8af3f06
commit 15eb781f80
3 changed files with 9 additions and 0 deletions

View file

@ -61,12 +61,15 @@ class ApplicationServicesHandler(object):
Args: Args:
current_id(int): The current maximum ID. current_id(int): The current maximum ID.
""" """
logger.info("call notify_interested_services")
services = self.store.get_app_services() services = self.store.get_app_services()
if not services or not self.notify_appservices: if not services or not self.notify_appservices:
logger.info("ret not services or not self.notify_appservices")
return return
self.current_max = max(self.current_max, current_id) self.current_max = max(self.current_max, current_id)
if self.is_processing: if self.is_processing:
logger.info("ret self.is_processing")
return return
with Measure(self.clock, "notify_interested_services"): with Measure(self.clock, "notify_interested_services"):
@ -79,6 +82,7 @@ class ApplicationServicesHandler(object):
) )
if not events: if not events:
logger.info("ret not events")
break break
events_by_room = {} events_by_room = {}

View file

@ -782,6 +782,7 @@ class EventCreationHandler(object):
def _notify(): def _notify():
try: try:
logger.info("call _notify")
self.notifier.on_new_room_event( self.notifier.on_new_room_event(
event, event_stream_id, max_stream_id, event, event_stream_id, max_stream_id,
extra_users=extra_users extra_users=extra_users

View file

@ -222,6 +222,7 @@ class Notifier(object):
until all previous events have been persisted before notifying until all previous events have been persisted before notifying
the client streams. the client streams.
""" """
logger.info("call on_new_room_event")
self.pending_new_room_events.append(( self.pending_new_room_events.append((
room_stream_id, event, extra_users room_stream_id, event, extra_users
)) ))
@ -236,6 +237,7 @@ class Notifier(object):
max_room_stream_id(int): The highest stream_id below which all max_room_stream_id(int): The highest stream_id below which all
events have been persisted. events have been persisted.
""" """
logger.info("call _notify_pending_new_room_events")
pending = self.pending_new_room_events pending = self.pending_new_room_events
self.pending_new_room_events = [] self.pending_new_room_events = []
for room_stream_id, event, extra_users in pending: for room_stream_id, event, extra_users in pending:
@ -249,6 +251,7 @@ class Notifier(object):
def _on_new_room_event(self, event, room_stream_id, extra_users=[]): def _on_new_room_event(self, event, room_stream_id, extra_users=[]):
"""Notify any user streams that are interested in this room event""" """Notify any user streams that are interested in this room event"""
# poke any interested application service. # poke any interested application service.
logger.info("call _on_new_room_event")
run_as_background_process( run_as_background_process(
"notify_app_services", "notify_app_services",
self._notify_app_services, room_stream_id, self._notify_app_services, room_stream_id,
@ -268,6 +271,7 @@ class Notifier(object):
@defer.inlineCallbacks @defer.inlineCallbacks
def _notify_app_services(self, room_stream_id): def _notify_app_services(self, room_stream_id):
logger.info("call _notify_app_services")
try: try:
yield self.appservice_handler.notify_interested_services(room_stream_id) yield self.appservice_handler.notify_interested_services(room_stream_id)
except Exception: except Exception: