mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:26:09 -04:00
Wrap a number of things that run in the background
This will reduce the number of "Starting db connection from sentinel context" warnings, and will help with our metrics.
This commit is contained in:
parent
1e5dbdcbb1
commit
371da42ae4
9 changed files with 63 additions and 22 deletions
|
@ -21,6 +21,7 @@ from canonicaljson import json
|
|||
from twisted.internet import defer
|
||||
|
||||
from synapse.api.errors import StoreError
|
||||
from synapse.metrics.background_process_metrics import run_as_background_process
|
||||
from synapse.util.caches.descriptors import cached, cachedInlineCallbacks, cachedList
|
||||
|
||||
from ._base import Cache, SQLBaseStore
|
||||
|
@ -711,6 +712,9 @@ class DeviceStore(SQLBaseStore):
|
|||
|
||||
logger.info("Pruned %d device list outbound pokes", txn.rowcount)
|
||||
|
||||
return self.runInteraction(
|
||||
"_prune_old_outbound_device_pokes", _prune_txn
|
||||
run_as_background_process(
|
||||
"prune_old_outbound_device_pokes",
|
||||
self.runInteraction,
|
||||
"_prune_old_outbound_device_pokes",
|
||||
_prune_txn,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue