]> cat aescling's git repositories - mastodon.git/commitdiff
Fix redis configuration not being changed by mastodon:setup (#18383)
authorClaire <claire.github-309c@sitedethib.com>
Mon, 9 May 2022 21:19:11 +0000 (23:19 +0200)
committersingle-right-quote <11325618-aescling@users.noreply.gitlab.com>
Fri, 27 May 2022 03:32:56 +0000 (23:32 -0400)
Fixes #18342

lib/tasks/mastodon.rake

index a89af6778074391c315176bd009572665997334d..d652468b37fb7318ee3c31ada99c79c5dea3c9ad 100644 (file)
@@ -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|