summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2020-03-10 14:40:28 +0000
committerBrendan Abolivier <babolivier@matrix.org>2020-03-10 14:40:28 +0000
commitdc6fb56c5ffb41d907b7fd645a701c2d9684afc3 (patch)
tree5d424c90a1ab60fcce7b5fead976fc678a4a4c13 /synapse/storage/database.py
parentAttempt at appeasing the gods of mypy (diff)
downloadsynapse-dc6fb56c5ffb41d907b7fd645a701c2d9684afc3.tar.xz
Hopefully mypy is happy now
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r--synapse/storage/database.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py

index 609db40616..e61595336c 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py
@@ -29,7 +29,11 @@ from twisted.internet import defer from synapse.api.errors import StoreError from synapse.config.database import DatabaseConnectionConfig -from synapse.logging.context import LoggingContext, make_deferred_yieldable +from synapse.logging.context import ( + LoggingContext, + LoggingContextOrSentinel, + make_deferred_yieldable, +) from synapse.metrics.background_process_metrics import run_as_background_process from synapse.storage.background_updates import BackgroundUpdater from synapse.storage.engines import BaseDatabaseEngine, PostgresEngine, Sqlite3Engine @@ -543,7 +547,9 @@ class Database(object): Returns: Deferred: The result of func """ - parent_context = LoggingContext.current_context() + parent_context = ( + LoggingContext.current_context() + ) # type: Optional[LoggingContextOrSentinel] if parent_context == LoggingContext.sentinel: logger.warning( "Starting db connection from sentinel context: metrics will be lost"