mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
fix aria2 process killing completely (cross-platform)
This commit is contained in:
@@ -1,14 +1,27 @@
|
||||
from core.utils.data.state import state
|
||||
import threading
|
||||
import psutil
|
||||
import sys
|
||||
|
||||
|
||||
shutdown_event = threading.Event()
|
||||
|
||||
def kill_aria2server():
|
||||
if sys.platform.startswith("win"):
|
||||
process = "aria2c.exe"
|
||||
else:
|
||||
process = "aria2c"
|
||||
|
||||
if state.aria2process:
|
||||
state.aria2process.kill()
|
||||
if state.debug:
|
||||
print("\nKilled Aria2")
|
||||
print("Killed Aria2")
|
||||
|
||||
for proc in psutil.process_iter():
|
||||
if proc.name() == process:
|
||||
proc.kill()
|
||||
if state.debug:
|
||||
print("Killed Aria2c")
|
||||
|
||||
|
||||
def closehelper():
|
||||
|
||||
Reference in New Issue
Block a user