From f0ec192e8d20249a21cf5de9948b6246fb2f68dd Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Mon, 5 Oct 2020 18:04:14 +0200 Subject: [PATCH] try to fix "too many open files" error --- asyncutils.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/asyncutils.nim b/asyncutils.nim index 51baf95..6339fc6 100644 --- a/asyncutils.nim +++ b/asyncutils.nim @@ -34,8 +34,10 @@ proc asyncExecCmd*(command: string): Future[string] = (result, exitCode) = execCmdEx(command) if exitCode != 0: failureEvent.trigger() + successEvent.close() else: successEvent.trigger() + failureEvent.close() let flowVar = spawn execCmdBackground(successEvent, failureEvent, command) proc successCallback(fd: AsyncFD): bool = future.complete(^flowVar)