mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Merge pull request #131 from YunoHost/unfinished_process_bug
Unfinished process bug
This commit is contained in:
commit
e13756721c
1 changed files with 11 additions and 0 deletions
|
@ -81,6 +81,17 @@ def call_async_output(args, callback, **kwargs):
|
|||
time.sleep(.1)
|
||||
stdout_reader.join()
|
||||
stdout_consum.join()
|
||||
|
||||
# on slow hardware, in very edgy situations it is possible that the process
|
||||
# isn't finished just after having closed stdout and stderr, so we wait a
|
||||
# bit to give hime the time to finish (while having a timeout)
|
||||
# Note : p.poll() returns None is the process hasn't finished yet
|
||||
start = time.time()
|
||||
while time.time() - start < 10:
|
||||
if p.poll() is not None:
|
||||
return p.poll()
|
||||
time.sleep(.1)
|
||||
|
||||
return p.poll()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue