mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-04 23:24:09 -04:00
Convert additional database methods to async (select list, search, insert_many, delete_*) (#8168)
This commit is contained in:
parent
4a739c73b4
commit
30426c7063
8 changed files with 67 additions and 84 deletions
|
@ -14,7 +14,7 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from typing import Dict, Iterable, List, Optional, Tuple
|
||||
from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Tuple
|
||||
|
||||
from canonicaljson import encode_canonical_json
|
||||
|
||||
|
@ -27,6 +27,9 @@ from synapse.util import json_encoder
|
|||
from synapse.util.caches.descriptors import cached, cachedList
|
||||
from synapse.util.iterutils import batch_iter
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from synapse.handlers.e2e_keys import SignatureListItem
|
||||
|
||||
|
||||
class EndToEndKeyWorkerStore(SQLBaseStore):
|
||||
@trace
|
||||
|
@ -730,14 +733,16 @@ class EndToEndKeyStore(EndToEndKeyWorkerStore, SQLBaseStore):
|
|||
stream_id,
|
||||
)
|
||||
|
||||
def store_e2e_cross_signing_signatures(self, user_id, signatures):
|
||||
async def store_e2e_cross_signing_signatures(
|
||||
self, user_id: str, signatures: "Iterable[SignatureListItem]"
|
||||
) -> None:
|
||||
"""Stores cross-signing signatures.
|
||||
|
||||
Args:
|
||||
user_id (str): the user who made the signatures
|
||||
signatures (iterable[SignatureListItem]): signatures to add
|
||||
user_id: the user who made the signatures
|
||||
signatures: signatures to add
|
||||
"""
|
||||
return self.db_pool.simple_insert_many(
|
||||
await self.db_pool.simple_insert_many(
|
||||
"e2e_cross_signing_signatures",
|
||||
[
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue