fix: close process handle after termination (#1856)

This commit is contained in:
Quet Zal
2022-04-30 13:33:15 +03:00
committed by GitHub
parent 8fe79f9d1d
commit a59ada7914

View File

@@ -53,9 +53,8 @@ function AsyncJob:close(force)
self:_for_each_pipe(function(p) self:_for_each_pipe(function(p)
p:close(force) p:close(force)
end) end)
if not self.handle:is_closing() then
self.handle:close() uv.process_kill(self.handle, "SIGTERM")
end
log.debug "[async_job] closed" log.debug "[async_job] closed"
end end
@@ -67,6 +66,9 @@ M.spawn = function(opts)
self.uv_opts, self.uv_opts,
async.void(function() async.void(function()
self:close(false) self:close(false)
if not self.handle:is_closing() then
self.handle:close()
end
end) end)
) )