SIENTIAPDE-1148
refactor: streamline Temporal connection logic in temporal_manager.py and remove redundant logging in worker.py
This commit is contained in:
@@ -40,20 +40,25 @@ class TemporalManager(BaseActivity):
|
||||
notification_handler=notification_handler)
|
||||
|
||||
async def connect_to_temporal(self):
|
||||
self.logger.info("Connecting to Temporal side namespaces...")
|
||||
|
||||
self.logger.info(
|
||||
f"Connecting to Temporal side namespaces at {self.host}")
|
||||
self.logger.info(f"Scouter namespace: {self.scouter_namespace}")
|
||||
|
||||
scouter_client = await Client.connect(
|
||||
target_host=self.host,
|
||||
namespace=self.scouter_namespace
|
||||
)
|
||||
|
||||
self.logger.info(f"Laborious namespace: {self.laborious_namespace}")
|
||||
|
||||
laborious_client = await Client.connect(
|
||||
target_host=self.host,
|
||||
namespace=self.laborious_namespace
|
||||
)
|
||||
|
||||
self.temporal_clients = {
|
||||
self.scouter_namespace: await Client.connect(
|
||||
target_host=self.host,
|
||||
namespace=self.scouter_namespace
|
||||
),
|
||||
self.laborious_namespace: await Client.connect(
|
||||
target_host=self.host,
|
||||
namespace=self.laborious_namespace
|
||||
)
|
||||
self.scouter_namespace: scouter_client,
|
||||
self.laborious_namespace: laborious_client
|
||||
}
|
||||
|
||||
@activity.defn(name="load_schedule")
|
||||
|
||||
@@ -49,8 +49,6 @@ async def main():
|
||||
notification_handler=notification_handler
|
||||
)
|
||||
|
||||
logger.info('Connecting to Temporal side namespaces...')
|
||||
|
||||
await activities.connect_to_temporal()
|
||||
|
||||
logger.info('Starting Workers...')
|
||||
|
||||
Reference in New Issue
Block a user