Was wäre der beste Weg, um einen abgelösten Prozess aus einem Python -Prozess zu starten?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Was wäre der beste Weg, um einen abgelösten Prozess aus einem Python -Prozess zu starten?

by Anonymous » 17 Mar 2025, 02:53

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?>

Top