mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 00:15:10 -04:00
Consistently use wrap_as_background_task in more places (#8599)
This commit is contained in:
parent
84c0e46cce
commit
9e0f22874f
5 changed files with 20 additions and 30 deletions
|
@ -33,7 +33,10 @@ from synapse.api.room_versions import (
|
|||
from synapse.events import EventBase, make_event_from_dict
|
||||
from synapse.events.utils import prune_event
|
||||
from synapse.logging.context import PreserveLoggingContext, current_context
|
||||
from synapse.metrics.background_process_metrics import run_as_background_process
|
||||
from synapse.metrics.background_process_metrics import (
|
||||
run_as_background_process,
|
||||
wrap_as_background_process,
|
||||
)
|
||||
from synapse.replication.slave.storage._slaved_id_tracker import SlavedIdTracker
|
||||
from synapse.replication.tcp.streams import BackfillStream
|
||||
from synapse.replication.tcp.streams.events import EventsStream
|
||||
|
@ -140,10 +143,7 @@ class EventsWorkerStore(SQLBaseStore):
|
|||
if hs.config.run_background_tasks:
|
||||
# We periodically clean out old transaction ID mappings
|
||||
self._clock.looping_call(
|
||||
run_as_background_process,
|
||||
5 * 60 * 1000,
|
||||
"_cleanup_old_transaction_ids",
|
||||
self._cleanup_old_transaction_ids,
|
||||
self._cleanup_old_transaction_ids, 5 * 60 * 1000,
|
||||
)
|
||||
|
||||
self._get_event_cache = LruCache(
|
||||
|
@ -1374,6 +1374,7 @@ class EventsWorkerStore(SQLBaseStore):
|
|||
|
||||
return mapping
|
||||
|
||||
@wrap_as_background_process("_cleanup_old_transaction_ids")
|
||||
async def _cleanup_old_transaction_ids(self):
|
||||
"""Cleans out transaction id mappings older than 24hrs.
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue