fix:Fixed the problem of plugin installation failure caused by incons… (#22156)

This commit is contained in:
Garden12138
2025-07-11 15:18:42 +08:00
committed by GitHub
parent fe4e2f7921
commit 2a85f28963

View File

@@ -427,6 +427,9 @@ class PluginService:
manager = PluginInstaller()
# collect actual plugin_unique_identifiers
actual_plugin_unique_identifiers = []
metas = []
features = FeatureService.get_system_features()
# check if already downloaded
@@ -437,6 +440,8 @@ class PluginService:
# check if the plugin is available to install
PluginService._check_plugin_installation_scope(plugin_decode_response.verification)
# already downloaded, skip
actual_plugin_unique_identifiers.append(plugin_unique_identifier)
metas.append({"plugin_unique_identifier": plugin_unique_identifier})
except Exception:
# plugin not installed, download and upload pkg
pkg = download_plugin_pkg(plugin_unique_identifier)
@@ -447,17 +452,15 @@ class PluginService:
)
# check if the plugin is available to install
PluginService._check_plugin_installation_scope(response.verification)
# use response plugin_unique_identifier
actual_plugin_unique_identifiers.append(response.unique_identifier)
metas.append({"plugin_unique_identifier": response.unique_identifier})
return manager.install_from_identifiers(
tenant_id,
plugin_unique_identifiers,
actual_plugin_unique_identifiers,
PluginInstallationSource.Marketplace,
[
{
"plugin_unique_identifier": plugin_unique_identifier,
}
for plugin_unique_identifier in plugin_unique_identifiers
],
metas,
)
@staticmethod