mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-09 08:53:10 +00:00
readd prevention of hanging when closing process streams on windows
This commit is contained in:
parent
ee0d2866c8
commit
e69319b5a2
@ -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