From d1442a06c3c9e0a5ab2238ef2bef2cbfae79af7f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 8 May 2021 17:15:06 +0200 Subject: Bump version to 3.4.0rc1 (#16053) --- lib/mastodon/version.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index bd0915775..0a0a7878b 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -9,7 +9,7 @@ module Mastodon end def minor - 3 + 4 end def patch @@ -17,7 +17,7 @@ module Mastodon end def flags - '' + 'rc1' end def suffix -- cgit From 9b18914c3572be5b661e4d8e31578fae4ee347be Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Sun, 9 May 2021 17:40:17 +0900 Subject: Add a Redis environment variable for sidekiq (#16188) --- config/initializers/sidekiq.rb | 11 ++--------- lib/mastodon/redis_config.rb | 12 ++++++++++-- 2 files changed, 12 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index fc85a3913..219554df4 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,14 +1,7 @@ # frozen_string_literal: true -namespace = ENV.fetch('REDIS_NAMESPACE') { nil } -redis_params = { url: ENV['REDIS_URL'], driver: :hiredis } - -if namespace - redis_params[:namespace] = namespace -end - Sidekiq.configure_server do |config| - config.redis = redis_params + config.redis = REDIS_SIDEKIQ_PARAMS config.server_middleware do |chain| chain.add SidekiqErrorHandler @@ -26,7 +19,7 @@ Sidekiq.configure_server do |config| end Sidekiq.configure_client do |config| - config.redis = redis_params + config.redis = REDIS_SIDEKIQ_PARAMS config.client_middleware do |chain| chain.add SidekiqUniqueJobs::Middleware::Client diff --git a/lib/mastodon/redis_config.rb b/lib/mastodon/redis_config.rb index d341a8484..5bfd26e34 100644 --- a/lib/mastodon/redis_config.rb +++ b/lib/mastodon/redis_config.rb @@ -22,9 +22,11 @@ end setup_redis_env_url setup_redis_env_url(:cache, false) +setup_redis_env_url(:sidekiq, false) -namespace = ENV.fetch('REDIS_NAMESPACE', nil) -cache_namespace = namespace ? namespace + '_cache' : 'cache' +namespace = ENV.fetch('REDIS_NAMESPACE', nil) +cache_namespace = namespace ? namespace + '_cache' : 'cache' +sidekiq_namespace = namespace REDIS_CACHE_PARAMS = { driver: :hiredis, @@ -32,3 +34,9 @@ REDIS_CACHE_PARAMS = { expires_in: 10.minutes, namespace: cache_namespace, }.freeze + +REDIS_SIDEKIQ_PARAMS = { + driver: :hiredis, + url: ENV['SIDEKIQ_REDIS_URL'], + namespace: sidekiq_namespace, +}.freeze -- cgit