Skip to content

Commit

Permalink
Raise an exception after 3 attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Mason committed Sep 8, 2017
1 parent 9f70a21 commit f3835ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ Rails.application.load_tasks

if ENV['IN_DOCKER']
def wait_for_db_container
loop do
3.times do
return if connect_to_db
sleep 1
end
raise RuntimeError.new 'Could not establish connection to postgres in 3 attempts'
end

def connect_to_db
Expand Down

0 comments on commit f3835ab

Please sign in to comment.