mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
feat: support plugin max package size
This commit is contained in:
@ -5,12 +5,11 @@ from core.helper.download import download_with_size_limit
|
||||
|
||||
|
||||
def get_plugin_pkg_url(plugin_unique_identifier: str):
|
||||
return (
|
||||
URL(str(dify_config.MARKETPLACE_API_URL))
|
||||
/ "api/v1/plugins/download"
|
||||
).with_query(unique_identifier=plugin_unique_identifier)
|
||||
return (URL(str(dify_config.MARKETPLACE_API_URL)) / "api/v1/plugins/download").with_query(
|
||||
unique_identifier=plugin_unique_identifier
|
||||
)
|
||||
|
||||
|
||||
def download_plugin_pkg(plugin_unique_identifier: str):
|
||||
url = str(get_plugin_pkg_url(plugin_unique_identifier))
|
||||
return download_with_size_limit(url, 15 * 1024 * 1024)
|
||||
return download_with_size_limit(url, dify_config.PLUGIN_MAX_PACKAGE_SIZE)
|
||||
|
||||
Reference in New Issue
Block a user