fix: close process handle after termination (#1856)
This commit is contained in:
@@ -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)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user