|
@@ -7,7 +7,9 @@ import (
|
|
|
"github.com/langgenius/dify-plugin-daemon/internal/utils/cache"
|
|
|
)
|
|
|
|
|
|
-func CombinedGetPluginDeclaration(plugin_unique_identifier plugin_entities.PluginUniqueIdentifier) (*plugin_entities.PluginDeclaration, error) {
|
|
|
+func CombinedGetPluginDeclaration(
|
|
|
+ plugin_unique_identifier plugin_entities.PluginUniqueIdentifier,
|
|
|
+) (*plugin_entities.PluginDeclaration, error) {
|
|
|
return cache.AutoGetWithGetter(
|
|
|
plugin_unique_identifier.String(),
|
|
|
func() (*plugin_entities.PluginDeclaration, error) {
|
|
@@ -18,18 +20,11 @@ func CombinedGetPluginDeclaration(plugin_unique_identifier plugin_entities.Plugi
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
- if err == nil {
|
|
|
- return &declaration.Declaration, nil
|
|
|
- }
|
|
|
-
|
|
|
- model, err := db.GetOne[models.Plugin](
|
|
|
- db.Equal("plugin_unique_identifier", plugin_unique_identifier.String()),
|
|
|
- )
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
- return &model.Declaration, nil
|
|
|
+ return &declaration.Declaration, nil
|
|
|
},
|
|
|
)
|
|
|
}
|