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

Commit

Permalink
Fix reference to potentially undefined config.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep authored Nov 15, 2023
1 parent c3d3afe commit 8debbdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion synapse/storage/databases/main/media_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ def __init__(
self._drop_media_index_without_method,
)

self.unused_expiration_time = hs.config.media.unused_expiration_time
if hs.config.media.can_load_media_repo:
self.unused_expiration_time = hs.config.media.unused_expiration_time
else:
self.unused_expiration_time = None

async def _drop_media_index_without_method(
self, progress: JsonDict, batch_size: int
Expand Down Expand Up @@ -489,6 +492,7 @@ def get_pending_media_txn(txn: LoggingTransaction) -> Tuple[int, int]:
AND created_ts > ?
AND media_length IS NULL
"""
assert self.unused_expiration_time is not None
txn.execute(
sql,
(
Expand Down

0 comments on commit 8debbdf

Please sign in to comment.