try to fix "too many open files" error

This commit is contained in:
Christian Ulrich 2020-10-05 18:07:34 +02:00
parent 1719e07c97
commit 149ac0df06
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 2 additions and 0 deletions

View File

@ -34,8 +34,10 @@ proc asyncExecCmd*(command: string): Future[string] =
(result, exitCode) = execCmdEx(command) (result, exitCode) = execCmdEx(command)
if exitCode != 0: if exitCode != 0:
failureEvent.trigger() failureEvent.trigger()
successEvent.unregister()
else: else:
successEvent.trigger() successEvent.trigger()
failureEvent.unregister()
let flowVar = spawn execCmdBackground(successEvent, failureEvent, command) let flowVar = spawn execCmdBackground(successEvent, failureEvent, command)
proc successCallback(fd: AsyncFD): bool = proc successCallback(fd: AsyncFD): bool =
future.complete(^flowVar) future.complete(^flowVar)