diff options
author | Erik Johnston <erikj@matrix.org> | 2023-09-15 09:10:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-15 09:10:24 +0100 |
commit | edec0b93cabbe5e03d658a2aa4c2c1b79cf8e85e (patch) | |
tree | 3d0fb030ed7cdf4a1b0a6d9549c1fbb877da11ea /synapse/metrics | |
parent | Some minor performance fixes for task schedular (#16313) (diff) | |
download | synapse-edec0b93cabbe5e03d658a2aa4c2c1b79cf8e85e.tar.xz |
Only use literal strings for process names (#16315)
Diffstat (limited to 'synapse/metrics')
-rw-r--r-- | synapse/metrics/background_process_metrics.py | 7 |
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]]"], |