Skip to content

Commit

Permalink
Merge pull request #2 from porter-dev/ym/fail_w_code
Browse files Browse the repository at this point in the history
fail with exit code link
  • Loading branch information
portersupport authored Mar 25, 2024
2 parents 92099dc + 7c35233 commit 0410ec3
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 0410ec3

Please sign in to comment.