Skip to content

Commit fa63525

Browse files
authored
feat(curl): Make synchronous curl timeout configurable (#475)
PR for: #231
1 parent 253d348 commit fa63525

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/plenary/curl.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ all curl methods accepts
1111
raw = "any additonal curl args, it must be an array/list." (array)
1212
dry_run = "whether to return the args to be ran through curl." (boolean)
1313
output = "where to download something." (filepath)
14+
timeout = "request timeout in mseconds" (number)
1415
1516
and returns table:
1617
@@ -278,7 +279,8 @@ local request = function(specs)
278279
if opts.callback then
279280
return job:start()
280281
else
281-
job:sync(10000)
282+
local timeout = opts.timeout or 10000
283+
job:sync(timeout)
282284
return response
283285
end
284286
end

0 commit comments

Comments
 (0)