Skip to content

Commit

Permalink
FIX(cache_critical_dns): use discourse database name and user by defa…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Pacuilla authored May 17, 2022
1 parent 9ea8a4a commit 9f246e6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions script/cache_critical_dns
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ CRITICAL_HOST_ENV_VARS = %w{
DISCOURSE_REDIS_SLAVE_HOST
DISCOURSE_REDIS_REPLICA_HOST
}

DEFAULT_DB_NAME = "discourse"

HOST_RESOLVER_CACHE = {}
HOST_HEALTHY_CACHE = {}
HOSTS_PATH = ENV['DISCOURSE_DNS_CACHE_HOSTS_FILE'] || "/etc/hosts"
Expand Down Expand Up @@ -171,15 +174,15 @@ HEALTH_CHECKS = {
"DISCOURSE_DB_HOST": lambda { |addr|
postgres_healthcheck(
host: addr,
user: ENV["DISCOURSE_DB_USER_NAME"],
password: ENV["DISCOURSE_DB_PASSWORD"],
dbname: ENV["DISCOURSE_DB_NAME"])},
user: ENV["DISCOURSE_DB_USER_NAME"] || DEFAULT_DB_NAME,
dbname: ENV["DISCOURSE_DB_NAME"] || DEFAULT_DB_NAME,
password: ENV["DISCOURSE_DB_PASSWORD"])},
"DISCOURSE_DB_REPLICA_HOST": lambda { |addr|
postgres_healthcheck(
host: addr,
user: ENV["DISCOURSE_DB_USER_NAME"],
password: ENV["DISCOURSE_DB_PASSWORD"],
dbname: ENV["DISCOURSE_DB_NAME"])},
user: ENV["DISCOURSE_DB_USER_NAME"] || DEFAULT_DB_NAME,
dbname: ENV["DISCOURSE_DB_NAME"] || DEFAULT_DB_NAME,
password: ENV["DISCOURSE_DB_PASSWORD"])},
"DISCOURSE_REDIS_HOST": lambda { |addr|
redis_healthcheck(
host: addr,
Expand Down

0 comments on commit 9f246e6

Please sign in to comment.