diff options
author | Erik Johnston <erik@matrix.org> | 2018-10-08 14:06:19 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-10-08 14:06:19 +0100 |
commit | 69823205722662a72e4203ec304ff595a0f6ecf7 (patch) | |
tree | 32ddb3011ef0cd63da66f528e77cd306b11e18b7 /synapse/handlers/appservice.py | |
parent | Use errback pattern and catch async failures (diff) | |
download | synapse-69823205722662a72e4203ec304ff595a0f6ecf7.tar.xz |
Remove unnecessary extra function call layer
Diffstat (limited to 'synapse/handlers/appservice.py')
-rw-r--r-- | synapse/handlers/appservice.py | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py index 16b897eb18..17eedf4dbf 100644 --- a/synapse/handlers/appservice.py +++ b/synapse/handlers/appservice.py @@ -28,7 +28,7 @@ from synapse.metrics import ( event_processing_loop_room_count, ) from synapse.metrics.background_process_metrics import run_as_background_process -from synapse.util import make_log_failure_errback +from synapse.util import log_failure from synapse.util.logcontext import make_deferred_yieldable, run_in_background from synapse.util.metrics import Measure @@ -37,17 +37,6 @@ logger = logging.getLogger(__name__) events_processed_counter = Counter("synapse_handlers_appservice_events_processed", "") -def log_failure(failure): - logger.error( - "Application Services Failure", - exc_info=( - failure.type, - failure.value, - failure.getTracebackObject() - ) - ) - - class ApplicationServicesHandler(object): def __init__(self, hs): @@ -114,10 +103,9 @@ class ApplicationServicesHandler(object): if not self.started_scheduler: def start_scheduler(): return self.scheduler.start().addErrback( - make_log_failure_errback( - "Application Services Failure", - ) + log_failure, "Application Services Failure", ) + run_as_background_process("as_scheduler", start_scheduler) self.started_scheduler = True |