summary refs log tree commit diff
path: root/synapse/metrics/background_process_metrics.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@matrix.org>2023-09-15 09:10:24 +0100
committerGitHub <noreply@github.com>2023-09-15 09:10:24 +0100
commitedec0b93cabbe5e03d658a2aa4c2c1b79cf8e85e (patch)
tree3d0fb030ed7cdf4a1b0a6d9549c1fbb877da11ea /synapse/metrics/background_process_metrics.py
parentSome minor performance fixes for task schedular (#16313) (diff)
downloadsynapse-edec0b93cabbe5e03d658a2aa4c2c1b79cf8e85e.tar.xz
Only use literal strings for process names (#16315)
Diffstat (limited to 'synapse/metrics/background_process_metrics.py')
-rw-r--r--synapse/metrics/background_process_metrics.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/metrics/background_process_metrics.py b/synapse/metrics/background_process_metrics.py

index f1f1f0cdf9..fceb7a9f3c 100644 --- a/synapse/metrics/background_process_metrics.py +++ b/synapse/metrics/background_process_metrics.py
@@ -48,6 +48,9 @@ from synapse.metrics._types import Collector if TYPE_CHECKING: import resource + # Old versions don't have `LiteralString` + from typing_extensions import LiteralString + logger = logging.getLogger(__name__) @@ -191,7 +194,7 @@ R = TypeVar("R") def run_as_background_process( - desc: str, + desc: "LiteralString", func: Callable[..., Awaitable[Optional[R]]], *args: Any, bg_start_span: bool = True, @@ -259,7 +262,7 @@ P = ParamSpec("P") def wrap_as_background_process( - desc: str, + desc: "LiteralString", ) -> Callable[ [Callable[P, Awaitable[Optional[R]]]], Callable[P, "defer.Deferred[Optional[R]]"],