Skip to content

Commit

Permalink
Add element FCs to search
Browse files Browse the repository at this point in the history
  • Loading branch information
aanil committed Nov 12, 2024
1 parent 42bae21 commit 4aab030
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions status/flowcells.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ class FlowcellSearchHandler(SafeHandler):
cached_fc_list = None
cached_xfc_list = None
cached_ont_fc_list = None
cached_element_fc_list = None
last_fetched = None

def get(self, search_string):
Expand Down Expand Up @@ -287,6 +288,13 @@ def search_flowcell_names(self, search_string=""):
)
FlowcellSearchHandler.cached_ont_fc_list = [row.key for row in ont_fc_view]

element_fc_view = self.application.element_runs_db.view(
"info/name", descending=True
)
FlowcellSearchHandler.cached_element_fc_list = [
row.key for row in element_fc_view
]

FlowcellSearchHandler.last_fetched = datetime.datetime.now()

search_string = search_string.lower()
Expand Down Expand Up @@ -314,6 +322,17 @@ def search_flowcell_names(self, search_string=""):
except AttributeError:
pass

for row_key in FlowcellSearchHandler.cached_element_fc_list:
try:
if search_string in row_key.lower():
fc = {
"url": f"/flowcells_element/{row_key}",
"name": row_key,
}
flowcells.append(fc)
except AttributeError:
pass

for row_key in FlowcellSearchHandler.cached_fc_list:
try:
if search_string in row_key.lower():
Expand Down

0 comments on commit 4aab030

Please sign in to comment.