Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make synchronous curl timeout configurable #231

Closed
jameshiew opened this issue Sep 7, 2021 · 2 comments
Closed

Make synchronous curl timeout configurable #231

jameshiew opened this issue Sep 7, 2021 · 2 comments

Comments

@jameshiew
Copy link
Contributor

jameshiew commented Sep 7, 2021

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 jameshiew changed the title Synchronous curl calls time out after 10s Make synchronous curl timeout configurable Sep 7, 2021
@Conni2461
Copy link
Collaborator

why not. PR welcome :)

@Conni2461
Copy link
Collaborator

fixed with fa63525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants