plenary.nvim icon indicating copy to clipboard operation
plenary.nvim copied to clipboard

Make synchronous curl timeout configurable

Open jameshiew opened this issue 4 years ago • 1 comments

Calling something like curl.post synchronously (i.e without a callback) has a maximum timeout of 10s as the curl call is wrapped by a job with a 10s timeout.

-- curl.lua
  if opts.callback then
    return job:start()
  else
    job:sync(10000)
    return response
  end

Rather than passing in 10000, could an extra option be passed to the curl method instead? e.g. timeout

  if opts.callback then
    return job:start()
  else
    local timeout = 10000
    if opts.timeout then
        timeout = opts.timeout
    end
    job:sync(timeout)
    return response
  end

jameshiew avatar Sep 07 '21 12:09 jameshiew

why not. PR welcome :)

Conni2461 avatar Oct 24 '21 06:10 Conni2461