fix(pre-startup): update pre_startup get_config for test, production and local usage
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
Pre-startup script for BEC client. This script is executed before the BEC client
|
||||
is started. It can be used to add additional command line arguments.
|
||||
"""
|
||||
|
||||
import os
|
||||
import csaxs_bec
|
||||
from bec_lib.service_config import ServiceConfig
|
||||
|
||||
def extend_command_line_args(parser):
|
||||
"""
|
||||
@@ -14,8 +16,14 @@ def extend_command_line_args(parser):
|
||||
return parser
|
||||
|
||||
|
||||
# def get_config() -> ServiceConfig:
|
||||
# """
|
||||
# Create and return the service configuration.
|
||||
# """
|
||||
# return ServiceConfig(redis={"host": "localhost", "port": 6379})
|
||||
def get_config() -> ServiceConfig:
|
||||
"""
|
||||
Create and return the service configuration.
|
||||
"""
|
||||
path = os.path.dirname(csaxs_bec.__file__)
|
||||
if path.startswith('/data/test/x12sa-test-bec/production'):
|
||||
return ServiceConfig(redis={"host": "x12sa-bec-001", "port": 6379})
|
||||
elif path.startswith('/data/test/x12sa-test-bec/test'):
|
||||
return ServiceConfig(redis={"host": "x12sa-bec-002", "port": 6379})
|
||||
else:
|
||||
return ServiceConfig(redis={"host": "localhost", "port": 6379})
|
||||
|
||||
Reference in New Issue
Block a user