Delegate to cached version when using get_filtered_current_state_ids
In the case where it gets called with `StateFilter.all()`
This commit is contained in:
parent
82345bc09a
commit
10523241d8
|
@ -510,6 +510,12 @@ class StateGroupWorkerStore(EventsWorkerStore, SQLBaseStore):
|
||||||
event ID.
|
event ID.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
where_clause, where_args = state_filter.make_sql_filter_clause()
|
||||||
|
|
||||||
|
if not where_clause:
|
||||||
|
# We delegate to the cached version
|
||||||
|
return self.get_current_state_ids(room_id)
|
||||||
|
|
||||||
def _get_filtered_current_state_ids_txn(txn):
|
def _get_filtered_current_state_ids_txn(txn):
|
||||||
results = {}
|
results = {}
|
||||||
sql = """
|
sql = """
|
||||||
|
@ -517,8 +523,6 @@ class StateGroupWorkerStore(EventsWorkerStore, SQLBaseStore):
|
||||||
WHERE room_id = ?
|
WHERE room_id = ?
|
||||||
"""
|
"""
|
||||||
|
|
||||||
where_clause, where_args = state_filter.make_sql_filter_clause()
|
|
||||||
|
|
||||||
if where_clause:
|
if where_clause:
|
||||||
sql += " AND (%s)" % (where_clause,)
|
sql += " AND (%s)" % (where_clause,)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue