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

Commit

Permalink
Proper return type for pusher_throttle.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Oct 24, 2023
1 parent 36559c8 commit 5153b9a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions synapse/storage/databases/main/pusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ async def get_throttle_params_by_room(
self, pusher_id: int
) -> Dict[str, ThrottleParams]:
res = cast(
List[Tuple[str, int, int]],
List[Tuple[str, Optional[int], Optional[int]]],
await self.db_pool.simple_select_list(
"pusher_throttle",
{"pusher": pusher_id},
Expand All @@ -383,7 +383,9 @@ async def get_throttle_params_by_room(

params_by_room = {}
for room_id, last_sent_ts, throttle_ms in res:
params_by_room[room_id] = ThrottleParams(last_sent_ts, throttle_ms)
params_by_room[room_id] = ThrottleParams(
last_sent_ts or 0, throttle_ms or 0
)

return params_by_room

Expand Down

0 comments on commit 5153b9a

Please sign in to comment.