|
57 | 57 | make_tuple_in_list_sql_clause, |
58 | 58 | ) |
59 | 59 | from synapse.storage.databases.main.cache import CacheInvalidationWorkerStore |
60 | | -from synapse.storage.engines import PostgresEngine |
| 60 | +from synapse.storage.engines import PostgresEngine, Psycopg2Engine |
61 | 61 | from synapse.storage.util.id_generators import MultiWriterIdGenerator |
62 | 62 | from synapse.types import JsonDict, JsonMapping |
63 | 63 | from synapse.util import json_decoder, json_encoder |
@@ -1134,7 +1134,7 @@ async def claim_e2e_one_time_keys( |
1134 | 1134 | """ |
1135 | 1135 | results: Dict[str, Dict[str, Dict[str, JsonDict]]] = {} |
1136 | 1136 | missing: List[Tuple[str, str, str, int]] = [] |
1137 | | - if isinstance(self.database_engine, PostgresEngine): |
| 1137 | + if isinstance(self.database_engine, Psycopg2Engine): |
1138 | 1138 | # If we can use execute_values we can use a single batch query |
1139 | 1139 | # in autocommit mode. |
1140 | 1140 | unfulfilled_claim_counts: Dict[Tuple[str, str, str], int] = {} |
@@ -1197,7 +1197,7 @@ async def claim_e2e_fallback_keys( |
1197 | 1197 | Returns: |
1198 | 1198 | A map of user ID -> a map device ID -> a map of key ID -> JSON. |
1199 | 1199 | """ |
1200 | | - if isinstance(self.database_engine, PostgresEngine): |
| 1200 | + if isinstance(self.database_engine, Psycopg2Engine): |
1201 | 1201 | return await self.db_pool.runInteraction( |
1202 | 1202 | "_claim_e2e_fallback_keys_bulk", |
1203 | 1203 | self._claim_e2e_fallback_keys_bulk_txn, |
@@ -1230,7 +1230,7 @@ def _claim_e2e_fallback_keys_bulk_txn( |
1230 | 1230 | SET used = used OR mark_as_used |
1231 | 1231 | FROM claims |
1232 | 1232 | WHERE (k.user_id, k.device_id, k.algorithm) = (claims.user_id, claims.device_id, claims.algorithm) |
1233 | | - RETURNING k.user_id, k.device_id, k.algorithm, k.key_id, k.key_json; |
| 1233 | + RETURNING k.user_id, k.device_id, k.algorithm, k.key_id, k.key_json |
1234 | 1234 | """ |
1235 | 1235 | claimed_keys = cast( |
1236 | 1236 | List[Tuple[str, str, str, str, str]], |
|
0 commit comments