mirror of
https://github.com/apache/superset.git
synced 2026-06-08 17:19:20 +00:00
fix(extensions): make LOCAL_EXTENSIONS loading resilient to individual failures (#38217)
This commit is contained in:
committed by
GitHub
parent
fca8a49561
commit
974bee14c3
@@ -257,17 +257,20 @@ def get_extensions() -> dict[str, LoadedExtension]:
|
||||
|
||||
# Load extensions from LOCAL_EXTENSIONS configuration (filesystem paths)
|
||||
for path in current_app.config["LOCAL_EXTENSIONS"]:
|
||||
files = get_bundle_files_from_path(path)
|
||||
# Use absolute filesystem path to dist directory for tracebacks
|
||||
abs_dist_path = str((Path(path) / "dist").resolve())
|
||||
extension = get_loaded_extension(files, source_base_path=abs_dist_path)
|
||||
extension_id = extension.manifest.id
|
||||
extensions[extension_id] = extension
|
||||
logger.info(
|
||||
"Loading extension %s (ID: %s) from local filesystem",
|
||||
extension.name,
|
||||
extension_id,
|
||||
)
|
||||
try:
|
||||
files = get_bundle_files_from_path(path)
|
||||
# Use absolute filesystem path to dist directory for tracebacks
|
||||
abs_dist_path = str((Path(path) / "dist").resolve())
|
||||
extension = get_loaded_extension(files, source_base_path=abs_dist_path)
|
||||
extension_id = extension.manifest.id
|
||||
extensions[extension_id] = extension
|
||||
logger.info(
|
||||
"Loading extension %s (ID: %s) from local filesystem",
|
||||
extension.name,
|
||||
extension_id,
|
||||
)
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
logger.error("Failed to load extension from %s: %s", path, e)
|
||||
|
||||
# Load extensions from discovery path (.supx files)
|
||||
if extensions_path := current_app.config.get("EXTENSIONS_PATH"):
|
||||
|
||||
Reference in New Issue
Block a user