mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Hopefully mypy is happy now
This commit is contained in:
parent
fe593ef990
commit
dc6fb56c5f
2 changed files with 10 additions and 3 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue