浏览代码

fix: avoid empty installation id

Yeuoly 8 月之前
父节点
当前提交
72d842f52f
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      internal/core/plugin_manager/remote_manager/hooks.go

+ 4 - 2
internal/core/plugin_manager/remote_manager/hooks.go

@@ -118,8 +118,10 @@ func (s *DifyServer) OnClose(c gnet.Conn, err error) (action gnet.Action) {
 	// uninstall plugin
 	if plugin.assetsTransferred {
 		if _mode != _PLUGIN_RUNTIME_MODE_CI {
-			if err := plugin.Unregister(); err != nil {
-				log.Error("unregister plugin failed, error: %v", err)
+			if plugin.installationId != "" {
+				if err := plugin.Unregister(); err != nil {
+					log.Error("unregister plugin failed, error: %v", err)
+				}
 			}
 
 			// decrease current connection