mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
add server restart api endpoint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -89,10 +89,16 @@ def post_log(req: models.ReqPostLog):
|
||||
return Response(status_code=204)
|
||||
|
||||
def post_shutdown(background_tasks: BackgroundTasks):
|
||||
log.info("Shutdown request received")
|
||||
log.info("Server shutdown request received")
|
||||
background_tasks.add_task(os._exit, 0)
|
||||
return Response(status_code=204)
|
||||
|
||||
def post_restart(background_tasks: BackgroundTasks):
|
||||
log.info("Server restart request received")
|
||||
from installer import restart
|
||||
background_tasks.add_task(restart)
|
||||
return Response(status_code=204)
|
||||
|
||||
def get_cmd_flags():
|
||||
return vars(shared.cmd_opts)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user