mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-16 04:13:09 +00:00
readd prevention of hanging when closing process streams on windows
This commit is contained in:
parent
1dc20de0c2
commit
b9dd464a93
@ -137,10 +137,19 @@ method stop*(
|
||||
error = e.msg
|
||||
writeStackTrace()
|
||||
finally:
|
||||
trace "closing node process' streams"
|
||||
await node.process.closeWait()
|
||||
node.process = nil
|
||||
trace "node process' streams closed"
|
||||
proc closeProcessStreams() {.async: (raises: []).} =
|
||||
trace "closing node process' streams"
|
||||
await node.process.closeWait()
|
||||
node.process = nil
|
||||
trace "node process' streams closed"
|
||||
|
||||
# windows will hang waiting to close process streams, so we can asyncspawn
|
||||
# in the hopes that it will eventually close them without hanging the
|
||||
# process
|
||||
when defined(windows):
|
||||
asyncSpawn closeProcessStreams()
|
||||
else:
|
||||
await closeProcessStreams()
|
||||
|
||||
proc waitUntilOutput*(
|
||||
node: NodeProcess, output: string
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user