I am running many subprocesses from python flask server via subprocess.Popen() and am saving reference to each one into dictionary. Server is not waiting until subprocess finishes. After some time (5sec, 5min, etc) I try to verify if subprocess finished - via .poll() function. Everything works as expected but now I need to add to it functionality of saving timestamps when was process started (this is no problem) and when was process finished (this is problem) How can I get exact finish timestamp from Popen instance? Since I am checking process after some time it could be that it finished earlier then I check. I tried searching here but it seems Popen instances do not keep this value? https://docs.python.org/3/library/subprocess.html#subprocess.Popen
Thank you for you time and help
I tried to check log of every subprocess for last modified time, but this seems inefficient to me as it could happen that not every subprocess will create log file.