<commit_before>require 'sidekiq'
require 'sidekiq/web'

config_file = "#{Rails.root}/config/redis.yml"
redis_config = YAML.load(ERB.new(File.read(config_file)).result)[Rails.env]

redis_conn = proc do
  Redis.new(redis_config)
end
Sidekiq.configure_client do |config|
  config.redis = ConnectionPool.new(size: 2, &redis_conn)
end
Sidekiq.configure_server do |config|
  config.redis = ConnectionPool.new(size: 7, &redis_conn)
  config.server_middleware do |chain|
    chain.remove Sidekiq::Middleware::Server::RetryJobs
  end
end

if !Rails.env.development?
  Sidekiq::Web.use Rack::Auth::Basic do |username, password|
    username == 'admin' && password == ENV["<PASSWORD>"]
  end
end<commit_msg>fix(): use yaml safe load to load redis config<commit_after>require 'sidekiq'
require 'sidekiq/web'

config_file = "#{Rails.root}/config/redis.yml"
redis_config = YAML.safe_load(ERB.new(File.read(config_file)).result)[Rails.env]

redis_conn = proc do
  Redis.new(redis_config)
end
Sidekiq.configure_client do |config|
  config.redis = ConnectionPool.new(size: 2, &redis_conn)
end
Sidekiq.configure_server do |config|
  config.redis = ConnectionPool.new(size: 7, &redis_conn)
  config.server_middleware do |chain|
    chain.remove Sidekiq::Middleware::Server::RetryJobs
  end
end

if !Rails.env.development?
  Sidekiq::Web.use Rack::Auth::Basic do |username, password|
    username == 'admin' && password == ENV["<PASSWORD>"]
  end
end
{'fraction_non_alphanumeric': 0.13636363636363635, 'fraction_numerical': 0.002797202797202797, 'mean_word_length': 5.71830985915493, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3928339', 'n_tokens_mistral': 534, 'n_tokens_neox': 526, 'n_words': 103}