SIENTIAPDE-1325
Refactor initialization of Activities, Gates, and MongoDB classes for improved readability by using multi-line argument formatting. Update related tests to match the new initialization style.
This commit is contained in:
@@ -83,7 +83,12 @@ class Activities(Postgres, Redis, Gates, MongoDB):
|
||||
)
|
||||
|
||||
# Initialize Gates
|
||||
Gates.__init__(self, logger=logger, notification_handler=notification_handler, metrics_controller=metrics_controller)
|
||||
Gates.__init__(
|
||||
self,
|
||||
logger=logger,
|
||||
notification_handler=notification_handler,
|
||||
metrics_controller=metrics_controller,
|
||||
)
|
||||
|
||||
# Initialize MongoDB
|
||||
MongoDB.__init__(
|
||||
|
||||
@@ -37,7 +37,12 @@ class Gates(SientiaMonitoring):
|
||||
ensure data integrity and enable flexible data processing workflows.
|
||||
"""
|
||||
|
||||
def __init__(self, logger: Logger, notification_handler: NotificationHandler, metrics_controller: MetricsController):
|
||||
def __init__(
|
||||
self,
|
||||
logger: Logger,
|
||||
notification_handler: NotificationHandler,
|
||||
metrics_controller: MetricsController,
|
||||
):
|
||||
"""
|
||||
Initialize the Gates class with logging and notification services.
|
||||
|
||||
|
||||
@@ -60,7 +60,12 @@ class MongoDB(SientiaMonitoring):
|
||||
metrics_controller=metrics_controller,
|
||||
)
|
||||
|
||||
SientiaMonitoring.__init__(self, logger=logger, notification_handler=notification_handler, metrics_controller=metrics_controller)
|
||||
SientiaMonitoring.__init__(
|
||||
self,
|
||||
logger=logger,
|
||||
notification_handler=notification_handler,
|
||||
metrics_controller=metrics_controller,
|
||||
)
|
||||
|
||||
def close(self):
|
||||
"""
|
||||
|
||||
@@ -134,10 +134,8 @@ async def main():
|
||||
try:
|
||||
await asyncio.gather(*handlers)
|
||||
|
||||
except BaseException as e: # NOSONAR
|
||||
logger.custom_error(
|
||||
'An unhandled exception occurred: %s', metadata=metadata
|
||||
)
|
||||
except BaseException: # NOSONAR
|
||||
logger.custom_error('An unhandled exception occurred: %s', metadata=metadata)
|
||||
finally:
|
||||
if notification_handler:
|
||||
notification_handler.shutdown()
|
||||
|
||||
Reference in New Issue
Block a user