Replace uses of simple_insert_many with simple_insert_many_values. (#11742)

This should be (slightly) more efficient and it is simpler
to have a single method for inserting multiple values.
This commit is contained in:
Patrick Cloke 2022-01-13 19:44:18 -05:00 committed by GitHub
parent d70169bf9b
commit 3e0536cd2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 263 additions and 298 deletions

View file

@ -561,13 +561,9 @@ class PusherStore(PusherWorkerStore):
self.db_pool.simple_insert_many_txn(
txn,
table="deleted_pushers",
keys=("stream_id", "app_id", "pushkey", "user_id"),
values=[
{
"stream_id": stream_id,
"app_id": pusher.app_id,
"pushkey": pusher.pushkey,
"user_id": user_id,
}
(stream_id, pusher.app_id, pusher.pushkey, user_id)
for stream_id, pusher in zip(stream_ids, pushers)
],
)