Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6f4f1a29 authored by Lucas Nussbaum's avatar Lucas Nussbaum
Browse files

[dev/wiki] Add retry policy for login

parent 6dbcde47
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,20 @@ class WikiGenerator
end
def login(options)
if (options[:user] && options[:pwd])
@mw_client.log_in(options[:user], options[:pwd])
tries = 3
begin
if (options[:user] && options[:pwd])
@mw_client.log_in(options[:user], options[:pwd])
end
rescue
tries -= 1
if tries > 0
puts "Login failed. retrying..."
sleep(1)
retry
else
raise "Login failed and retries exhausted."
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment