Переглянути джерело

fix: endless local runtime

Yeuoly 8 місяців тому
батько
коміт
93a40fbb0b

+ 0 - 1
internal/core/plugin_manager/local_manager/run.go

@@ -155,7 +155,6 @@ func (r *LocalPluginRuntime) StartPlugin() error {
 	wg.Wait()
 
 	// plugin has exited
-	r.SetPending()
 	return nil
 }
 

+ 1 - 5
internal/core/plugin_manager/uninstall.go

@@ -1,17 +1,13 @@
 package plugin_manager
 
 import (
-	"os"
-	"path/filepath"
-
 	"github.com/langgenius/dify-plugin-daemon/internal/types/entities/plugin_entities"
 )
 
 // UninstallFromLocal uninstalls a plugin from local storage
 // once deleted, local runtime will automatically shutdown and exit after several time
 func (p *PluginManager) UninstallFromLocal(identity plugin_entities.PluginUniqueIdentifier) error {
-	plugin_installation_path := filepath.Join(p.pluginStoragePath, identity.String())
-	if err := os.RemoveAll(plugin_installation_path); err != nil {
+	if err := p.installedBucket.Delete(identity); err != nil {
 		return err
 	}
 	// send shutdown runtime