Skip to content

Commit

Permalink
fail with exit code link
Browse files Browse the repository at this point in the history
  • Loading branch information
porter authored and porter committed Mar 25, 2024
1 parent 92099dc commit 7c35233
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ def status_path():
return "service shutting down", 503
return "", 200

@app.route('/exit/<int:status_code>', 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)
Expand Down

0 comments on commit 7c35233

Please sign in to comment.