-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
# Initialize Redis connection | ||
$redis = Redis.new(url: ENV['REDIS_URL'], ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE }) | ||
Rails.logger.info("Redis initializer is being loaded") | ||
Rails.logger.info("Redis URL: #{$redis.client.options[:url]}") | ||
Rails.logger.info("SSL Params: #{$redis.client.options[:ssl_params]}") | ||
begin | ||
Rails.logger.info("Redis PING: #{$redis.ping}") | ||
rescue StandardError => e | ||
Rails.logger.error("Redis connection failed: #{e.message}") | ||
end | ||
|
||
# Log Redis connection details | ||
Rails.logger.info("REDIS_URL: #{ENV['REDIS_URL']}") | ||
|
||
# Conditional block to prevent Redis commands during asset precompilation | ||
unless ENV['ASSET_PRECOMPILE'] | ||
# Log connection details if not in asset precompilation mode | ||
Rails.logger.info("Redis URL: #{$redis.client.options[:url]}") | ||
Rails.logger.info("SSL Params: #{$redis.client.options[:ssl_params]}") | ||
|
||
# Test Redis connection with a PING command | ||
begin | ||
Rails.logger.info("Redis PING: #{$redis.ping}") | ||
rescue StandardError => e | ||
Rails.logger.error("Redis connection failed: #{e.message}") | ||
end | ||
end |