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

Claim local one-time-keys in bulk #16565

Merged
merged 15 commits into from
Oct 30, 2023
Prev Previous commit
Next Next commit
Define missing using a comprehension
  • Loading branch information
David Robertson committed Oct 30, 2023
commit 19e1427d121ace660d91f80dad051060ca58551f
11 changes: 4 additions & 7 deletions synapse/storage/databases/main/end_to_end_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,13 +1152,10 @@ async def claim_e2e_one_time_keys(
unfulfilled_claim_counts[(user_id, device_id, algorithm)] -= 1

# Did we get enough OTKs?
for (
user_id,
device_id,
algorithm,
), count in unfulfilled_claim_counts.items():
if count > 0:
missing.append((user_id, device_id, algorithm, count))
missing = [
(user, device, alg, count)
for (user, device, alg), count in unfulfilled_claim_counts.items()
]
else:
for user_id, device_id, algorithm, count in query_list:
claim_rows = await self.db_pool.runInteraction(
Expand Down