mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -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
|
||||
|
||||
if not is_blank(stdin) then
|
||||
vim.cmd([[call jobsend(jobid, stdin)]])
|
||||
vim.api.nvim_chan_send(jobid, stdin)
|
||||
end
|
||||
|
||||
local res = vim.fn.jobwait({ jobid }, 30000)
|
||||
if res[1] == -1 then
|
||||
error('Command timed out: ' .. shellify(cmd))
|
||||
vim.cmd([[call jobstop(jobid)]])
|
||||
vim.fn.jobstop(jobid)
|
||||
elseif shell_error() and not ignore_error then
|
||||
local emsg = 'Command error (job='
|
||||
.. jobid
|
||||
|
Loading…
Reference in New Issue
Block a user