diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-11-07 14:00:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 14:00:25 -0500 |
commit | 9738b1c4975b293a1bc25ee27b5527724038baa1 (patch) | |
tree | 43c74a577da2f5eeda0f6a2806910de44163a57a /synapse/storage/databases/main/search.py | |
parent | More tests for the simple_* methods. (#16596) (diff) | |
download | synapse-9738b1c4975b293a1bc25ee27b5527724038baa1.tar.xz |
Avoid executing no-op queries. (#16583)
If simple_{insert,upsert,update}_many_txn is called without any data to modify then return instead of executing the query. This matches the behavior of simple_{select,delete}_many_txn.
Diffstat (limited to 'synapse/storage/databases/main/search.py')
-rw-r--r-- | synapse/storage/databases/main/search.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/storage/databases/main/search.py b/synapse/storage/databases/main/search.py index dbde9130c6..f4bef4c99b 100644 --- a/synapse/storage/databases/main/search.py +++ b/synapse/storage/databases/main/search.py @@ -106,7 +106,7 @@ class SearchWorkerStore(SQLBaseStore): txn, table="event_search", keys=("event_id", "room_id", "key", "value"), - values=( + values=[ ( entry.event_id, entry.room_id, @@ -114,7 +114,7 @@ class SearchWorkerStore(SQLBaseStore): _clean_value_for_search(entry.value), ) for entry in entries - ), + ], ) else: |