From 88cf8d753d091eb85f40a141515c161c8cc7e436 Mon Sep 17 00:00:00 2001 From: Mateusz779 Date: Wed, 12 Apr 2023 15:53:05 +0200 Subject: [PATCH] - --- app.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index f869c02..170fcd8 100644 --- a/app.py +++ b/app.py @@ -3,11 +3,19 @@ import db import os from werkzeug.utils import secure_filename import subprocess +import threading app = Flask(__name__) app.config['UPLOAD_FOLDER'] = "configs/squash" app.config['MAX_CONTENT_LENGTH'] = 1024 * 1024 * 512 #512MB +def ssh_thread_function(): + subprocess.run(['wssh','--fbidhttp=False']) + +ssh_thread = threading.Thread(target=ssh_thread_function) +ssh_thread.setDaemon() +ssh_thread.start() + @app.route("/api/addimage", methods=['POST']) def add_image(): db.Connect() @@ -61,6 +69,3 @@ def get_image(): filename = "default.squashfs" return send_file(os.path.join(app.config['UPLOAD_FOLDER'], filename)) - - -process = subprocess.run(['wssh','--fbidhttp=False']) \ No newline at end of file