mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-25 00:59:22 -05:00
Log when ASes are registered/unregistered.
This commit is contained in:
parent
ec3719b583
commit
fbeaeb8689
@ -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):
|
||||||
|
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user