rake mastodon:setup: Restore Redis config prior to creating an admin user

pull/22053/head
Dave MacDonald 2022-12-04 18:32:08 -05:00
parent 05d4c50f64
commit 5ee2d98b40
No known key found for this signature in database
GPG Key ID: 5425DE3500551488
1 changed files with 9 additions and 0 deletions

View File

@ -470,6 +470,15 @@ namespace :mastodon do
require_relative '../../config/environment'
disable_log_stdout!
# With the environment now reloaded, update Sidekiq to use the Redis config that was provided earlier interactively, in case it differs from the default localhost:6379.
# When the admin user is created, User dispatches an 'account.created' event to Sidekiq, which connects to Redis.
Sidekiq.configure_client do |config|
new_params = REDIS_SIDEKIQ_PARAMS.dup
new_params['url'] = "redis://:#{env['REDIS_PASSWORD']}@#{env['REDIS_HOST']}:#{env['REDIS_PORT']}/0"
new_params.freeze
config.redis = new_params
end
username = prompt.ask('Username:') do |q|
q.required true
q.default 'admin'