From ce7a820b6353f36ff590d937451aae8685975893 Mon Sep 17 00:00:00 2001 From: cl117 Date: Sun, 10 Nov 2024 15:14:23 -0700 Subject: [PATCH] change the flask decorator --- flask/config.json | 2 +- flask/explorer.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flask/config.json b/flask/config.json index ceceb42..a188e64 100644 --- a/flask/config.json +++ b/flask/config.json @@ -2,7 +2,7 @@ "uclust_identity": "0.8", "elasticsearch_index_name": "part", "pagerank_tolerance": "0.0001", - "elasticsearch_endpoint": "http://elasticsearch:9200/", + "elasticsearch_endpoint": "http://localhost:9200/", "sparql_endpoint": "http://localhost:8890/sparql?", "last_update_start": "none", "last_update_end": "none", diff --git a/flask/explorer.py b/flask/explorer.py index d32129f..97f3972 100644 --- a/flask/explorer.py +++ b/flask/explorer.py @@ -38,7 +38,6 @@ def handle_error(e): return jsonify(error=str(e.name + ": " + e.description)), e.code return jsonify(error=str(type(e).__name__) + str(e)), 500 -@app.before_request def startup(): def auto_update_index(): update_interval = int(config_manager.load_config().get('updateTimeInDays', 0)) * 86400 @@ -69,6 +68,8 @@ def auto_update_index(): except Exception as e: log.error(f'Error during startup: {e}') raise + +startup() def update_index(): logger_.log('============ STARTING INDEXING ============\n\n', True)