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

Commit

Permalink
Remove unneeded num_args in @cached decorators.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Apr 28, 2022
1 parent 5145bee commit 06a4d0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions synapse/storage/databases/main/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async def get_users_with_read_receipts_in_room(self, room_id: str) -> Set[str]:
receipts = await self.get_receipts_for_room(room_id, ReceiptTypes.READ)
return {r["user_id"] for r in receipts}

@cached(num_args=2)
@cached()
async def get_receipts_for_room(
self, room_id: str, receipt_type: str
) -> List[Dict[str, Any]]:
Expand All @@ -143,7 +143,7 @@ async def get_receipts_for_room(
desc="get_receipts_for_room",
)

@cached(num_args=3)
@cached()
async def get_last_receipt_event_id_for_user(
self, user_id: str, room_id: str, receipt_type: str
) -> Optional[str]:
Expand All @@ -170,7 +170,7 @@ async def get_last_receipt_event_id_for_user(
allow_none=True,
)

@cached(num_args=2)
@cached()
async def get_receipts_for_user(
self, user_id: str, receipt_type: str
) -> Dict[str, str]:
Expand Down Expand Up @@ -283,7 +283,7 @@ async def get_linearized_receipts_for_room(

return await self._get_linearized_receipts_for_room(room_id, to_key, from_key)

@cached(num_args=3, tree=True)
@cached(tree=True)
async def _get_linearized_receipts_for_room(
self, room_id: str, to_key: int, from_key: Optional[int] = None
) -> List[JsonDict]:
Expand Down

0 comments on commit 06a4d0b

Please sign in to comment.