Skip to content

Commit

Permalink
fix startup errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danmayer committed Jul 3, 2020
1 parent 13db64d commit fdeec24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/coverband/adapters/hash_redis_store.rb
Expand Up @@ -33,6 +33,9 @@ def initialize(redis, opts = {})

def supported?
Gem::Version.new(@redis.info["redis_version"]) >= Gem::Version.new("2.6.0")
rescue Redis::CannotConnectError => error
Coverband.configuration.logger.info "Redis is not available (#{error}), Coverband not configured"
Coverband.configuration.logger.info "If this is a setup task like assets:precompile feel free to ignore"
end

def clear!
Expand Down
9 changes: 7 additions & 2 deletions lib/coverband/utils/railtie.rb
Expand Up @@ -38,8 +38,13 @@ class Railtie < Rails::Railtie

config.before_configuration do
unless ENV["COVERBAND_DISABLE_AUTO_START"]
Coverband.configure
Coverband.start
begin
Coverband.configure
Coverband.start
rescue Redis::CannotConnectError => error
Coverband.configuration.logger.info "Redis is not available (#{error}), Coverband not configured"
Coverband.configuration.logger.info "If this is a setup task like assets:precompile feel free to ignore"
end
end
end

Expand Down

0 comments on commit fdeec24

Please sign in to comment.