mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add retry logic to plugin:install_all_official
(#19551)
This task sometimes fails in CI due to temporary network issues. Retrying twice should help resolve those situations without needing to manually restart the job.
This commit is contained in:
parent
e90c2cabfc
commit
a6af981e1b
@ -32,9 +32,16 @@ task 'plugin:install_all_official' do
|
|||||||
repo += ".git"
|
repo += ".git"
|
||||||
end
|
end
|
||||||
|
|
||||||
status = system("git clone #{repo} #{path}")
|
attempts = 0
|
||||||
unless status
|
begin
|
||||||
abort("Failed to clone #{repo}")
|
attempts += 1
|
||||||
|
system("git clone #{repo} #{path}", exception: true)
|
||||||
|
rescue StandardError
|
||||||
|
if attempts >= 3
|
||||||
|
abort("Failed to clone #{repo}")
|
||||||
|
end
|
||||||
|
STDERR.puts "Failed to clone #{repo}... trying again..."
|
||||||
|
retry
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user