Log when ASes are registered/unregistered.

This commit is contained in:
Kegan Dougal 2015-01-27 17:34:40 +00:00
parent ec3719b583
commit fbeaeb8689
2 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,7 @@ class ApplicationServicesHandler(BaseHandler):
@defer.inlineCallbacks @defer.inlineCallbacks
def register(self, app_service): def register(self, app_service):
logger.info("Register -> %s", app_service)
# check the token is recognised # check the token is recognised
try: try:
stored_service = yield self.store.get_app_service(app_service.token) stored_service = yield self.store.get_app_service(app_service.token)
@ -44,6 +45,7 @@ class ApplicationServicesHandler(BaseHandler):
# TODO store this AS # TODO store this AS
def unregister(self, token): def unregister(self, token):
logger.info("Unregister as_token=%s", token)
yield self.store.unregister_app_service(token) yield self.store.unregister_app_service(token)
def notify_interested_services(self, event): def notify_interested_services(self, event):

View File

@ -51,6 +51,9 @@ class ApplicationService(object):
return True return True
def __str__(self):
return "ApplicationService: %s" % (self.__dict__,)
class ApplicationServiceCache(object): class ApplicationServiceCache(object):
"""Caches ApplicationServices and provides utility functions on top. """Caches ApplicationServices and provides utility functions on top.
@ -83,7 +86,6 @@ class ApplicationServiceStore(SQLBaseStore):
def __init__(self, hs): def __init__(self, hs):
super(ApplicationServiceStore, self).__init__(hs) super(ApplicationServiceStore, self).__init__(hs)
self.cache = ApplicationServiceCache() self.cache = ApplicationServiceCache()
self.clock = hs.get_clock()
self._populate_cache() self._populate_cache()
def unregister_app_service(self, token): def unregister_app_service(self, token):