about summary refs log tree commit diff
path: root/lib/tasks
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-05-09 23:19:11 +0200
committerGitHub <noreply@github.com>2022-05-09 23:19:11 +0200
commitf714e24ff104c3525a9a31be442364d2be1273fd (patch)
tree292a811e035917d5cb05a59cfc3c9adf9e1504a9 /lib/tasks
parent2b8dc58b7ff7fb708687c08a75c99b3fb30efc49 (diff)
Fix redis configuration not being changed by mastodon:setup (#18383)
Fixes #18342
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/mastodon.rake8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index a89af6778..d652468b3 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -8,6 +8,14 @@ namespace :mastodon do
     prompt = TTY::Prompt.new
     env    = {}
 
+    # When the application code gets loaded, it runs `lib/mastodon/redis_configuration.rb`.
+    # This happens before application environment configuration and sets REDIS_URL etc.
+    # These variables are then used even when REDIS_HOST etc. are changed, so clear them
+    # out so they don't interfer with our new configuration.
+    ENV.delete('REDIS_URL')
+    ENV.delete('CACHE_REDIS_URL')
+    ENV.delete('SIDEKIQ_REDIS_URL')
+
     begin
       prompt.say('Your instance is identified by its domain name. Changing it afterward will break things.')
       env['LOCAL_DOMAIN'] = prompt.ask('Domain name:') do |q|