fix(ingestor): Remove __del__ methods for async shutdown

This commit is contained in:
Bruno Domingues
2026-08-05 15:25:06 -03:00
parent ef37122f56
commit 810bf54d56
3 changed files with 0 additions and 14 deletions

View File

@@ -1,4 +1,3 @@
import asyncio
import traceback
from copy import deepcopy
@@ -188,9 +187,6 @@ class IngestorManager(SientiaMonitoring):
await server.shutdown()
self.data_manager.shutdown()
def __del__(self):
asyncio.run(self.shutdown())
async def remove_server(self, server: str):
"""
Removes an OPC server from the ingestor.

View File

@@ -112,9 +112,6 @@ class OpcManager(SientiaMonitoring):
f'nodes={self.nodes}, subscriptions={self.subscriptions}'
)
def __del__(self):
asyncio.run(self.shutdown())
async def shutdown(self):
"""
Comprehensive cleanup method for graceful shutdown.

View File

@@ -170,13 +170,6 @@ async def test_shutdown(ingestor_manager):
ingestor_manager.data_manager.shutdown.assert_called_once()
@patch('ingestor.managers.ingestor_manager.asyncio')
def test___del__(asyncio_mock, ingestor_manager):
ingestor_manager.shutdown = MagicMock()
ingestor_manager.__del__()
asyncio_mock.run.assert_called_once_with(ingestor_manager.shutdown.return_value)
@mark.asyncio
async def test_remove_server(ingestor_manager):
server1 = AsyncMock()