Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions flask/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ def uclust2clusters():

def update_clusters():
logger_.log('------------ Updating clusters ------------', True)

# Re-read config (force a fresh load, not the value cached at import) so a
# flag set at runtime via /config is honored. When skip_clustering is set,
# skip the (very slow) uclust run and keep the clusters from the previous
# run -- update_index will leave the existing clusters_dump untouched.
config_manager._config = None
if config_manager.load_config().get('skip_clustering'):
logger_.log('******** skip_clustering=true: skipping uclust, reusing previous clusters ********', True)
logger_.log('------------ Clustering skipped (previous clusters kept) ------------\n', True)
return None

logger_.log('******** Query for sequences ********', True)
sequences_response = query.query_sparql(sequence_query)
logger_.log('******** Query for sequences complete ********', True)
Expand Down
14 changes: 1 addition & 13 deletions flask/config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
{
"uclust_identity": "0.8",
"elasticsearch_index_name": "part",
"pagerank_tolerance": "0.0001",
"elasticsearch_endpoint": "http://localhost:9200/",
"sparql_endpoint": "http://localhost:8890/sparql?",
"last_update_start": "none",
"last_update_end": "none",
"distributed_search": false,
"which_search": "vsearch",
"autoUpdateIndex": false,
"updateTimeInDays": "1"
}
{"uclust_identity": "0.8", "elasticsearch_index_name": "part", "pagerank_tolerance": "0.0001", "elasticsearch_endpoint": "http://localhost:9200/", "sparql_endpoint": "http://localhost:8890/sparql?", "last_update_start": "2026-06-30T15:42:11.762203", "last_update_end": "none", "distributed_search": false, "which_search": "vsearch", "autoUpdateIndex": false, "updateTimeInDays": "1", "skip_clustering": true}
3 changes: 2 additions & 1 deletion flask/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def update_index():
config_manager.save_update_start_time()

clusters = cluster.update_clusters()
data_manager.save_clusters(clusters)
if clusters is not None: # None => skip_clustering, keep existing clusters_dump
data_manager.save_clusters(clusters)

uri2rank = pagerank.update_pagerank()
data_manager.save_uri2rank(uri2rank)
Expand Down
Loading