mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-25 18:34:07 +08:00
🐛 fix(manager.py): catch and log exceptions when tearing down services to prevent silent failures
🐛 fix(utils.py): catch and log exceptions when tearing down services and superuser to prevent silent failures
This commit is contained in:
@ -90,7 +90,10 @@ class ServiceManager:
|
||||
if service is None:
|
||||
continue
|
||||
logger.debug(f"Teardown service {service.name}")
|
||||
service.teardown()
|
||||
try:
|
||||
service.teardown()
|
||||
except Exception as exc:
|
||||
logger.exception(exc)
|
||||
self.services = {}
|
||||
self.factories = {}
|
||||
self.dependencies = {}
|
||||
@ -150,9 +153,3 @@ def initialize_session_service():
|
||||
dependencies=[ServiceType.CACHE_SERVICE],
|
||||
)
|
||||
|
||||
|
||||
def teardown_services():
|
||||
"""
|
||||
Teardown all the services.
|
||||
"""
|
||||
service_manager.teardown()
|
||||
|
||||
@ -153,6 +153,9 @@ def teardown_services():
|
||||
"""
|
||||
try:
|
||||
teardown_superuser(get_settings_service(), next(get_session()))
|
||||
except Exception as exc:
|
||||
logger.exception(exc)
|
||||
try:
|
||||
service_manager.teardown()
|
||||
except Exception as exc:
|
||||
logger.exception(exc)
|
||||
|
||||
Reference in New Issue
Block a user