debian-mirror-gitlab/lib/system_check/app/redis_version_check.rb

28 lines
772 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2017-09-10 17:25:29 +05:30
module SystemCheck
module App
class RedisVersionCheck < SystemCheck::BaseCheck
2019-12-04 20:38:33 +05:30
MIN_REDIS_VERSION = '2.8.0'
2017-09-10 17:25:29 +05:30
set_name "Redis version >= #{MIN_REDIS_VERSION}?"
def check?
redis_version = run_command(%w(redis-cli --version))
redis_version = redis_version.try(:match, /redis-cli (\d+\.\d+\.\d+)/)
redis_version && (Gem::Version.new(redis_version[1]) > Gem::Version.new(MIN_REDIS_VERSION))
end
def show_error
try_fixing_it(
"Update your redis server to a version >= #{MIN_REDIS_VERSION}"
)
for_more_information(
'gitlab-public-wiki/wiki/Trouble-Shooting-Guide in section sidekiq'
)
fix_and_rerun
end
end
end
end