SIENTIAPDE-1148

refactor: streamline Temporal connection logic in temporal_manager.py and remove redundant logging in worker.py
This commit is contained in:
vitor-aignosi
2025-07-11 10:42:28 -03:00
parent 96af810755
commit 7279192343
2 changed files with 15 additions and 12 deletions

View File

@@ -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")

View File

@@ -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...')