This commit is contained in:
Beto Dealmeida
2025-12-03 17:26:28 -05:00
parent 5f61bb8d76
commit be31abeb7e
5 changed files with 433 additions and 31 deletions

View File

@@ -17,15 +17,11 @@
import logging
from datetime import timedelta
from typing import TYPE_CHECKING
from flask import Flask
from superset.engines.manager import EngineManager, EngineModes
if TYPE_CHECKING:
pass
logger = logging.getLogger(__name__)
@@ -74,7 +70,12 @@ class EngineManagerExtension:
def shutdown_engine_manager() -> None:
if self.engine_manager:
self.engine_manager.stop_cleanup_thread()
logger.info("Stopped EngineManager cleanup thread")
# Use a try-except to handle closed log file handlers during tests
try:
logger.info("Stopped EngineManager cleanup thread")
except ValueError:
# Ignore logging errors during test shutdown when file handles are closed
pass
app.teardown_appcontext_funcs.append(lambda exc: None)