mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
fix(health): stop job properly on timeout (#23877)
This commit is contained in:
parent
9f3c4c1526
commit
843c1bed95
@ -109,13 +109,13 @@ local function system(cmd, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not is_blank(stdin) then
|
if not is_blank(stdin) then
|
||||||
vim.cmd([[call jobsend(jobid, stdin)]])
|
vim.api.nvim_chan_send(jobid, stdin)
|
||||||
end
|
end
|
||||||
|
|
||||||
local res = vim.fn.jobwait({ jobid }, 30000)
|
local res = vim.fn.jobwait({ jobid }, 30000)
|
||||||
if res[1] == -1 then
|
if res[1] == -1 then
|
||||||
error('Command timed out: ' .. shellify(cmd))
|
error('Command timed out: ' .. shellify(cmd))
|
||||||
vim.cmd([[call jobstop(jobid)]])
|
vim.fn.jobstop(jobid)
|
||||||
elseif shell_error() and not ignore_error then
|
elseif shell_error() and not ignore_error then
|
||||||
local emsg = 'Command error (job='
|
local emsg = 'Command error (job='
|
||||||
.. jobid
|
.. jobid
|
||||||
|
Loading…
Reference in New Issue
Block a user