added function for checking if flask has been started

pull/783/head
Madis Kaal 2023-07-03 17:05:49 +03:00
rodzic 942c992f83
commit 0464b26add
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -49,7 +49,7 @@ app.jinja_env.auto_reload = True
# This thread will hold the currently running flask application thread.
flask_app_thread = None
# A key that needs to be matched to allow shutdown.
flask_shutdown_key = "temp"
flask_shutdown_key = None
# SocketIO instance
socketio = SocketIO(app, async_mode="threading")
@ -289,6 +289,9 @@ def flask_get_log_list():
""" Return a list of log files, as a list of objects """
return json.dumps(list_log_files(quicklook=True))
def flask_running():
global flask_shutdown_key
return flask_shutdown_key is not None
@app.route("/get_log_by_serial/<serial>")
def flask_get_log_by_serial(serial):