SIENTIAPDE-1174

SIENTIAPDE-1174 Add pod_id initialization in Activities class and update Scouter to reference it for improved consistency in environment variable handling.
This commit is contained in:
vitor-aignosi
2025-07-31 14:57:22 -03:00
parent ce20d86328
commit 5d3eb74022
2 changed files with 4 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ with workflow.unsafe.imports_passed_through():
from scouter.activities.gates import Gates from scouter.activities.gates import Gates
from scouter.activities.mongodb import MongoDB from scouter.activities.mongodb import MongoDB
from typing import Any from typing import Any
from os import getenv
class Activities(Postgres, Redis, Gates, MongoDB,): class Activities(Postgres, Redis, Gates, MongoDB,):
@@ -61,6 +62,8 @@ class Activities(Postgres, Redis, Gates, MongoDB,):
notification_handler=notification_handler notification_handler=notification_handler
) )
self.pod_id = getenv("HOSTNAME", "localhost")
def shutdown(self): def shutdown(self):
Postgres.close(self) Postgres.close(self)
MongoDB.shutdown(self) MongoDB.shutdown(self)

View File

@@ -39,7 +39,7 @@ class Scouter:
'model_name': input_data['model_name'], 'model_name': input_data['model_name'],
'schedule_name': input_data['schedule_name'], 'schedule_name': input_data['schedule_name'],
'workflow_name': input_data['workflow_name'], 'workflow_name': input_data['workflow_name'],
'pod_id': getenv("HOSTNAME", "localhost") 'pod_id': Activities.pod_id
} }
} }