Skip to content
Snippets Groups Projects

Retrieve children elements from SQLite cache in list_element_children

Merged Eva Bardou requested to merge use-local-cache into master
All threads resolved!
3 files
+ 4
17
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 1
3
@@ -848,13 +848,11 @@ class ElementsWorker(BaseWorker):
if self.cache:
# Checking that we only received query_params handled by the cache
assert set(query_params.keys()) <= {
"name",
"type",
"worker_version",
}, "When using the local cache, you can only filter by 'name', 'type' and/or 'worker_version'"
}, "When using the local cache, you can only filter by 'type' and/or 'worker_version'"
conditions = [("parent_id", "=", convert_str_uuid_to_hex(element.id))]
conditions += [("name", "LIKE", f"%{name}%")] if name else []
conditions += [("type", "=", type)] if type else []
conditions += (
[("worker_version_id", "=", convert_str_uuid_to_hex(worker_version))]
Loading