Skip to content

Commit 0a16cd6

Browse files
committed
Remove the !restart command (does not work)
1 parent 744429d commit 0a16cd6

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

app/commands.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -995,14 +995,9 @@ async def switchserv(ctx: Context) -> str | None:
995995
return "Have a nice journey.."
996996

997997

998-
@command(Privileges.ADMINISTRATOR, aliases=["restart"])
998+
@command(Privileges.ADMINISTRATOR)
999999
async def shutdown(ctx: Context) -> str | None | NoReturn:
10001000
"""Gracefully shutdown the server."""
1001-
if ctx.trigger == "restart":
1002-
_signal = signal.SIGUSR1
1003-
else:
1004-
_signal = signal.SIGTERM
1005-
10061001
if ctx.args: # shutdown after a delay
10071002
delay = timeparse(ctx.args[0])
10081003
if not delay:
@@ -1020,10 +1015,10 @@ async def shutdown(ctx: Context) -> str | None | NoReturn:
10201015

10211016
app.state.sessions.players.enqueue(app.packets.notification(alert_msg))
10221017

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)
10241019
return f"Enqueued {ctx.trigger}."
10251020
else: # shutdown immediately
1026-
os.kill(os.getpid(), _signal)
1021+
os.kill(os.getpid(), signal.SIGTERM)
10271022
return "Process killed"
10281023

10291024

0 commit comments

Comments
 (0)