diff --git a/backend/app.py b/backend/app.py index 65c2979..e1d69f8 100644 --- a/backend/app.py +++ b/backend/app.py @@ -612,8 +612,8 @@ def catchAll(path): return send_from_directory('./public', path) -if __name__ == '__main__': +def main(): LOG_LEVEL = os.getenv("LOG_LEVEL") if LOG_LEVEL: logging.basicConfig(level=eval("logging." + LOG_LEVEL)) @@ -634,12 +634,19 @@ if __name__ == '__main__': app.logger.addHandler(handler) """ - wait_for_elasticsearch() + #wait_for_elasticsearch() download_llm() connections.create_connection(hosts=app.config['elastic_uri'], request_timeout=60) + wait_for_elasticsearch() init_indicies() create_default_users() app.run(debug=False, threaded=True, host='0.0.0.0') +if __name__ == '__main__': + main() + + + + diff --git a/backend/lib/elastictools.py b/backend/lib/elastictools.py index 49cd281..569b6ab 100644 --- a/backend/lib/elastictools.py +++ b/backend/lib/elastictools.py @@ -88,6 +88,7 @@ def wait_for_elasticsearch(): while True: try: client = Elasticsearch(hosts=elastic_url) + client.indices.get_alias(index="*") #connections.create_connection(hosts=app.config['elastic_uri']) #connections.get_connection().cluster.health(wait_for_status='yellow') #init_indicies() @@ -100,3 +101,6 @@ def wait_for_elasticsearch(): print("Elasticsearch not found! Wait %s seconds!" % i, flush=True) + + + diff --git a/backend/public/index.html b/backend/public/index.html index bed7dae..0d684a7 100644 --- a/backend/public/index.html +++ b/backend/public/index.html @@ -192,6 +192,10 @@ Tweak bot +