Skip to content

Commit

Permalink
change the flask decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
cl117 committed Nov 10, 2024
1 parent 8107447 commit ce7a820
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flask/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion flask/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ce7a820

Please sign in to comment.