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

Commit

Permalink
Do not auto expire events
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Feb 16, 2021
1 parent 873da38 commit 2de6060
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion synapse/replication/tcp/external_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def delete(self, cache_name: str, key: str) -> None:
self._redis_connection.delete(self._get_redis_key(cache_name, key),)
)

async def set(self, cache_name: str, key: str, value: Any, expiry_ms: int) -> None:
async def set(self, cache_name: str, key: str, value: Any, expiry_ms: Optional[int] = None) -> None:
"""Add the key/value to the named cache, with the expiry time given.
"""

Expand Down
2 changes: 0 additions & 2 deletions synapse/storage/databases/main/events_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
EVENT_QUEUE_THREADS = 3 # Max number of threads that will fetch events
EVENT_QUEUE_ITERATIONS = 3 # No. times we block waiting for requests for events
EVENT_QUEUE_TIMEOUT_S = 0.1 # Timeout when waiting for requests for events
EVENT_EXPIRY_TIME = 24 * 60 * 60 * 1000
GET_EVENT_CACHE_NAME = "getEvent"

_EventCacheEntry = namedtuple("_EventCacheEntry", ("event", "redacted_event"))
Expand Down Expand Up @@ -877,7 +876,6 @@ async def _get_events_from_db(self, event_ids, allow_rejected=False):
GET_EVENT_CACHE_NAME,
event_id,
redis_cache_entry,
expiry_ms=EVENT_EXPIRY_TIME,
)

return result_map
Expand Down

0 comments on commit 2de6060

Please sign in to comment.