mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 18:04:49 -04:00
Fix logging context warnings due to common usage metrics setup (#14574)
`setup()` is run under the sentinel context manager, so we wrap the initial update in a background process. Before this change, Synapse would log two warnings on startup: Starting db txn 'count_daily_users' from sentinel context Starting db connection from sentinel context: metrics will be lost Signed-off-by: Sean Quah <seanq@matrix.org>
This commit is contained in:
parent
d748bbc8f8
commit
d56f48038a
2 changed files with 4 additions and 1 deletions
|
@ -54,7 +54,9 @@ class CommonUsageMetricsManager:
|
|||
|
||||
async def setup(self) -> None:
|
||||
"""Keep the gauges for common usage metrics up to date."""
|
||||
await self._update_gauges()
|
||||
run_as_background_process(
|
||||
desc="common_usage_metrics_update_gauges", func=self._update_gauges
|
||||
)
|
||||
self._clock.looping_call(
|
||||
run_as_background_process,
|
||||
5 * 60 * 1000,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue