Skip to content

Commit ee272e7

Browse files
committed
add scheduler/starter bind host env
1 parent 53a6ed2 commit ee272e7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

scheduler/app/flask_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
TIMEOUT_OUTPUT = (
3434
"The script's running time exceeded the limit and the execution was aborted."
3535
)
36+
HOST = os.environ.get("PYTHON_SCHEDULER_BIND_HOST", "127.0.0.1")
3637

3738
app = Flask(__name__)
3839

@@ -373,6 +374,5 @@ def base_run_python_statistics():
373374

374375

375376
if __name__ == "__main__":
376-
scheduler.start()
377-
http_server = WSGIServer(("0.0.0.0", 5055), app)
377+
http_server = WSGIServer((HOST, 5055), app)
378378
http_server.serve_forever()

starter/runner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
SEATABLE_USER_UID = 1000
7272
SEATABLE_USER_GID = 1000
7373

74+
# bind host
75+
HOST = os.environ.get("PYTHON_STARTER_BIND_HOST", "127.0.0.1")
76+
7477

7578
def get_log_level(level):
7679
if level.lower() == "info":
@@ -474,4 +477,4 @@ def health_check():
474477

475478

476479
if __name__ == "__main__":
477-
app.run(host="0.0.0.0", port=8088, debug=False)
480+
app.run(host=HOST, port=8088, debug=False)

0 commit comments

Comments
 (0)