Ich habe eine Fastapi-Anwendung und möchte einen anderen Prozess mit einem Python-Skript auf nicht blockierende Weise starten: < /p>
process = subprocess.Popen(
["python","my_script.py"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
stdin=subprocess.DEVNULL,
start_new_session=True # Detaches the process
)
< /code>
Jetzt ist das Problem, wenn dieser Prozess nicht als Zombie -Prozess bleibt. Nur wenn ich die Fastapi -Aplikation neu starte, stirbt der Prozess wirklich. Fastapi -Aplikation, die richtig sterben kann, wenn es ein Problem gibt?>
Was wäre der beste Weg, um einen abgelösten Prozess aus einem Python -Prozess zu starten? ⇐ Python
-
- Similar Topics
- Replies
- Views
- Last post