From ca4b251c815d01930cdd69372da9ce1f5a6cde9a Mon Sep 17 00:00:00 2001 From: Eyal Ben Ivri Date: Tue, 30 Jul 2024 12:15:13 +0200 Subject: [PATCH] changing app.run debug mode --- main.py | 4 ++-- pytest.ini | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index c715266..07d78d1 100644 --- a/main.py +++ b/main.py @@ -50,6 +50,7 @@ ##################### INIT GLOBAL VARIABLES ################################## PORT = int(os.environ.get("PORT", 8080)) +DEBUG = bool(os.environ.get("DEBUG", "False")) SERVICE_URL = os.environ.get("SERVICE_URL", f"http://localhost:{PORT}") TAG_ENGINE_SA = config['DEFAULT']['TAG_ENGINE_SA'].strip() @@ -3676,7 +3677,6 @@ def server_error(e): if __name__ == "__main__": #os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = "1" # uncomment only when running locally os.environ['OAUTHLIB_RELAX_TOKEN_SCOPE'] = "1" # to allow for scope changes - time.sleep(5000) - app.run(debug=True, host="0.0.0.0", port=PORT) # for running on Cloud Run + app.run(debug=DEBUG, host="0.0.0.0", port=PORT) # for running on Cloud Run #app.run(debug=True, port=5000) # for running locally \ No newline at end of file diff --git a/pytest.ini b/pytest.ini index 300c986..54bfe1e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,4 +2,5 @@ pythonpath = . env = SERVICE_URL=http://localhost:5000 - OAUTHLIB_INSECURE_TRANSPORT=1 \ No newline at end of file + OAUTHLIB_INSECURE_TRANSPORT=1 + DEBUG=True \ No newline at end of file