From 7c352331e375eebfb01cac0070f195ac72b964b0 Mon Sep 17 00:00:00 2001 From: porter Date: Mon, 25 Mar 2024 11:42:22 -0400 Subject: [PATCH] fail with exit code link --- web.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web.py b/web.py index acafc14..bea550f 100644 --- a/web.py +++ b/web.py @@ -105,6 +105,13 @@ def status_path(): return "service shutting down", 503 return "", 200 +@app.route('/exit/', methods=['GET']) +def exit_with_status(status_code): + """ + Exit the application with the specified status code. + """ + os._exit(status_code) + if __name__ == "__main__": signal.signal(signal.SIGTERM, handle_signal)