Skip to content

Commit

Permalink
Terminate process more gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
raidensakura committed Jun 6, 2023
1 parent f2d6915 commit 04fe9cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/scripts/loadcheck.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os
import signal
import subprocess
import sys
import time
Expand All @@ -12,7 +14,7 @@

file = open("modmail.log", "w")
proc = subprocess.Popen(
f"pipenv run bot",
"pipenv run bot",
stdout=file,
stderr=subprocess.STDOUT,
shell=True,
Expand All @@ -25,6 +27,8 @@

print("Stopping Modmail")

proc.terminate()
os.kill(proc.pid, signal.SIGINT)

time.sleep(5)

sys.exit(exit_code)

0 comments on commit 04fe9cc

Please sign in to comment.