SIENTIAPDE-1163
refactor: update Temporal client initialization to use environment variable for namespace, improving configuration flexibility
This commit is contained in:
@@ -20,6 +20,7 @@ with workflow.unsafe.imports_passed_through():
|
|||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
host = os.getenv('TEMPORAL_HOST', 'localhost:7233')
|
host = os.getenv('TEMPORAL_HOST', 'localhost:7233')
|
||||||
|
namespace = os.getenv('TEMPORAL_NAMESPACE', 'default')
|
||||||
logger = get_logger(__name__)
|
logger = get_logger(__name__)
|
||||||
|
|
||||||
logger.info('Starting Worker...')
|
logger.info('Starting Worker...')
|
||||||
@@ -34,11 +35,11 @@ async def main():
|
|||||||
project_name=os.getenv('PROJECT_NAME', 'orchestrator'),
|
project_name=os.getenv('PROJECT_NAME', 'orchestrator'),
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info('Starting Temporal Client...')
|
logger.info(f'Starting Temporal Client at {host}:{namespace}')
|
||||||
|
|
||||||
temporal_client = await client.Client.connect(
|
temporal_client = await client.Client.connect(
|
||||||
target_host=host,
|
target_host=host,
|
||||||
namespace=os.getenv('TEMPORAL_NAMESPACE', 'default')
|
namespace=namespace
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info('Starting Activities...')
|
logger.info('Starting Activities...')
|
||||||
|
|||||||
Reference in New Issue
Block a user