chore: formated with stylua (#564)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
e6e75f5e92
commit
dc31077bc5
|
@ -151,8 +151,8 @@ end
|
||||||
---@return any Result of fn.
|
---@return any Result of fn.
|
||||||
function M.retry_call(fn, args, times)
|
function M.retry_call(fn, args, times)
|
||||||
times = times or 3
|
times = times or 3
|
||||||
for _=0,times-1 do
|
for _ = 0, times - 1 do
|
||||||
local result = {pcall(fn, unpack(args))}
|
local result = { pcall(fn, unpack(args)) }
|
||||||
if result[1] == true then
|
if result[1] == true then
|
||||||
return unpack(result, 2)
|
return unpack(result, 2)
|
||||||
end
|
end
|
||||||
|
@ -166,7 +166,7 @@ end
|
||||||
---@return function retry call wraped function
|
---@return function retry call wraped function
|
||||||
function M.retry_call_wrap(fn, times)
|
function M.retry_call_wrap(fn, times)
|
||||||
return function(...)
|
return function(...)
|
||||||
return M.retry_call(fn, {...}, times)
|
return M.retry_call(fn, { ... }, times)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue