Move clear environment portion of mastodon:setup to private method (#33616)
				
					
				
			This commit is contained in:
		@@ -8,13 +8,7 @@ namespace :mastodon do
 | 
				
			|||||||
    prompt = TTY::Prompt.new
 | 
					    prompt = TTY::Prompt.new
 | 
				
			||||||
    env    = {}
 | 
					    env    = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # When the application code gets loaded, it runs `lib/mastodon/redis_configuration.rb`.
 | 
					    clear_environment!
 | 
				
			||||||
    # 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 interfere with our new configuration.
 | 
					 | 
				
			||||||
    ENV.delete('REDIS_URL')
 | 
					 | 
				
			||||||
    ENV.delete('CACHE_REDIS_URL')
 | 
					 | 
				
			||||||
    ENV.delete('SIDEKIQ_REDIS_URL')
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    begin
 | 
					    begin
 | 
				
			||||||
      errors = []
 | 
					      errors = []
 | 
				
			||||||
@@ -580,6 +574,17 @@ namespace :mastodon do
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  private
 | 
					  private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def clear_environment!
 | 
				
			||||||
 | 
					    # 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 interfere with our new configuration.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ENV.delete('REDIS_URL')
 | 
				
			||||||
 | 
					    ENV.delete('CACHE_REDIS_URL')
 | 
				
			||||||
 | 
					    ENV.delete('SIDEKIQ_REDIS_URL')
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def generate_header(include_warning)
 | 
					  def generate_header(include_warning)
 | 
				
			||||||
    default_message = "# Generated with mastodon:setup on #{Time.now.utc}\n\n"
 | 
					    default_message = "# Generated with mastodon:setup on #{Time.now.utc}\n\n"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user