Skip to content

Commit

Permalink
refactor: 移除 redis 版本检查
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Apr 8, 2024
1 parent 2a9f54c commit 6b15042
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
1 change: 0 additions & 1 deletion config/locales/zealot/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,6 @@ en:
optional_value: 'Optional value: %{value}'
invaild_in_demo_mode: Forbidden in demo mode
development_only: Development only
redis_connection_error: Redis server connect failed.
database_connection_error: Database server connect failed
goback_or_redirect_to_homepage: you may %{goback_link} or return to %{homepage_link}
goback_title: goback
Expand Down
9 changes: 1 addition & 8 deletions lib/tasks/zealot/zealot.rake
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

namespace :zealot do
MIN_REDIS_VERSION = '6.2'

desc 'Zealot | Upgrade zealot or setting up database'
task upgrade: :environment do
Rake::Task['zealot:version'].invoke
Expand All @@ -11,12 +9,7 @@ namespace :zealot do

desc 'Zealot | Precheck service healthly'
task precheck: :environment do
redis_version = Rails.cache.stats['redis_version']
if Gem::Version.new(redis_version) < Gem::Version.new(MIN_REDIS_VERSION)
raise "[ERROR] Redis server version requires 6.2+, current version is #{redis_version}."
end
rescue Redis::CannotConnectError
raise "[ERROR] Redis server can not connected."
# nothing to do
end

desc 'Zealot | Remove all data and init demo data and user'
Expand Down

0 comments on commit 6b15042

Please sign in to comment.