mirror of
https://github.com/katanemo/plano.git
synced 2026-05-05 05:42:49 +02:00
formating and mointoring change (#136)
This commit is contained in:
parent
976b2eaae0
commit
93abe553e3
8 changed files with 83 additions and 47 deletions
|
|
@ -10,6 +10,7 @@ import tempfile
|
|||
# Path to the file where the server process ID will be stored
|
||||
PID_FILE = os.path.join(tempfile.gettempdir(), "model_server.pid")
|
||||
|
||||
|
||||
def run_server():
|
||||
"""Start, stop, or restart the Uvicorn server based on command-line arguments."""
|
||||
if len(sys.argv) > 1:
|
||||
|
|
@ -45,10 +46,11 @@ def start_server():
|
|||
f.write(str(process.pid))
|
||||
print(f"ARCH GW Model Server started with PID {process.pid}")
|
||||
else:
|
||||
#Add model_server boot-up logs
|
||||
# Add model_server boot-up logs
|
||||
print(f"ARCH GW Model Server - Didn't Sart In Time. Shutting Down")
|
||||
process.terminate()
|
||||
|
||||
|
||||
def wait_for_health_check(url, timeout=180):
|
||||
"""Wait for the Uvicorn server to respond to health-check requests."""
|
||||
start_time = time.time()
|
||||
|
|
@ -92,6 +94,7 @@ def stop_server():
|
|||
process.kill() # Forcefully kill the process
|
||||
os.remove(PID_FILE)
|
||||
|
||||
|
||||
def restart_server():
|
||||
"""Restart the Uvicorn server."""
|
||||
print("Check: Is Archgw Model Server running?")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue