Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1870 from matrix-org/erikj/cache_get_all_new_events
Browse files Browse the repository at this point in the history
Add a small cache get_all_new_events
  • Loading branch information
erikjohnston authored Feb 1, 2017
2 parents 62f6b86 + 368c88c commit ebfaff8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions synapse/storage/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from synapse.api.constants import EventTypes
from synapse.api.errors import SynapseError
from synapse.state import resolve_events
from synapse.util.caches.descriptors import cached

from canonicaljson import encode_canonical_json
from collections import deque, namedtuple, OrderedDict
Expand Down Expand Up @@ -1571,6 +1572,7 @@ def get_current_backfill_token(self):
"""The current minimum token that backfilled events have reached"""
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,
current_backfill_id, current_forward_id, limit):
"""Get all the new events that have arrived at the server either as
Expand Down

0 comments on commit ebfaff8

Please sign in to comment.