test: characterize contracts and make startup explicit

This commit is contained in:
Media
2026-08-06 17:24:20 -05:00
parent fc27feaea1
commit 9091f27283
9 changed files with 695 additions and 56 deletions
+6 -2
View File
@@ -1,7 +1,7 @@
from flask import Flask, render_template_string, request, redirect, url_for, flash
import os
from controller_core import enqueue_download
from controller_core import enqueue_download, start_controller, stop_controller
app = Flask(__name__)
app.secret_key = os.environ.get("FLASK_SECRET_KEY", "dev-secret")
@@ -250,4 +250,8 @@ def submit():
return redirect(url_for("index"))
if __name__ == "__main__":
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 7531)))
start_controller()
try:
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 7531)))
finally:
stop_controller()