Skip to content

Commit

Permalink
solr-names-updater use gcp db
Browse files Browse the repository at this point in the history
  • Loading branch information
EPortman authored Jan 22, 2025
1 parent c8cdf3e commit da91758
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions services/solr-names-updater/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,10 @@ class Config(): # pylint: disable=too-few-public-methods
DB_NAME = os.getenv('DATABASE_NAME', '')
DB_HOST = os.getenv('DATABASE_HOST', '')
DB_PORT = os.getenv('DATABASE_PORT', '5432')
SQLALCHEMY_DATABASE_URI = 'postgresql://{user}:{password}@{host}:{port}/{name}'.format(
user=DB_USER,
password=DB_PASSWORD,
host=DB_HOST,
port=int(DB_PORT),
name=DB_NAME,
)
if DB_UNIX_SOCKET := os.getenv('DATABASE_UNIX_SOCKET', None):
SQLALCHEMY_DATABASE_URI = f'postgresql+psycopg2://{DB_USER}:{DB_PASSWORD}@/{DB_NAME}?host={DB_UNIX_SOCKET}'
else:
SQLALCHEMY_DATABASE_URI = f'postgresql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{int(DB_PORT)}/{DB_NAME}'

GCP_AUTH_KEY = os.getenv('BUSINESS_GCP_AUTH_KEY', None)
EMAILER_TOPIC = os.getenv('NAMEX_MAILER_TOPIC', '')
Expand Down

0 comments on commit da91758

Please sign in to comment.