mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-01-02 14:00:52 -05:00
Add a small cache get_all_new_events
This commit is contained in:
parent
5deaf9e30b
commit
368c88c487
@ -28,6 +28,7 @@ from synapse.util.metrics import Measure
|
|||||||
from synapse.api.constants import EventTypes
|
from synapse.api.constants import EventTypes
|
||||||
from synapse.api.errors import SynapseError
|
from synapse.api.errors import SynapseError
|
||||||
from synapse.state import resolve_events
|
from synapse.state import resolve_events
|
||||||
|
from synapse.util.caches.descriptors import cached
|
||||||
|
|
||||||
from canonicaljson import encode_canonical_json
|
from canonicaljson import encode_canonical_json
|
||||||
from collections import deque, namedtuple, OrderedDict
|
from collections import deque, namedtuple, OrderedDict
|
||||||
@ -1579,6 +1580,7 @@ class EventsStore(SQLBaseStore):
|
|||||||
"""The current minimum token that backfilled events have reached"""
|
"""The current minimum token that backfilled events have reached"""
|
||||||
return -self._backfill_id_gen.get_current_token()
|
return -self._backfill_id_gen.get_current_token()
|
||||||
|
|
||||||
|
@cached(num_args=5, max_entries=10)
|
||||||
def get_all_new_events(self, last_backfill_id, last_forward_id,
|
def get_all_new_events(self, last_backfill_id, last_forward_id,
|
||||||
current_backfill_id, current_forward_id, limit):
|
current_backfill_id, current_forward_id, limit):
|
||||||
"""Get all the new events that have arrived at the server either as
|
"""Get all the new events that have arrived at the server either as
|
||||||
|
Loading…
Reference in New Issue
Block a user