File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -995,14 +995,9 @@ async def switchserv(ctx: Context) -> str | None:
995
995
return "Have a nice journey.."
996
996
997
997
998
- @command (Privileges .ADMINISTRATOR , aliases = [ "restart" ] )
998
+ @command (Privileges .ADMINISTRATOR )
999
999
async def shutdown (ctx : Context ) -> str | None | NoReturn :
1000
1000
"""Gracefully shutdown the server."""
1001
- if ctx .trigger == "restart" :
1002
- _signal = signal .SIGUSR1
1003
- else :
1004
- _signal = signal .SIGTERM
1005
-
1006
1001
if ctx .args : # shutdown after a delay
1007
1002
delay = timeparse (ctx .args [0 ])
1008
1003
if not delay :
@@ -1020,10 +1015,10 @@ async def shutdown(ctx: Context) -> str | None | NoReturn:
1020
1015
1021
1016
app .state .sessions .players .enqueue (app .packets .notification (alert_msg ))
1022
1017
1023
- app .state .loop .call_later (delay , os .kill , os .getpid (), _signal )
1018
+ app .state .loop .call_later (delay , os .kill , os .getpid (), signal . SIGTERM )
1024
1019
return f"Enqueued { ctx .trigger } ."
1025
1020
else : # shutdown immediately
1026
- os .kill (os .getpid (), _signal )
1021
+ os .kill (os .getpid (), signal . SIGTERM )
1027
1022
return "Process killed"
1028
1023
1029
1024
You can’t perform that action at this time.
0 commit comments