This commit is contained in:
1-6
2023-07-26 18:08:37 +08:00
parent 35e4b1301e
commit 90494264d9
3 changed files with 12 additions and 12 deletions
+10 -10
View File
@@ -340,11 +340,11 @@ func (f *Factory) Push(msg map[string]string) map[string]string {
func (f *Factory) SetReplyHandler(function func(map[string]interface{}) string) { func (f *Factory) SetReplyHandler(function func(map[string]interface{}) string) {
f.reply = func(m map[string]interface{}) string { f.reply = func(m map[string]interface{}) string {
if f.uuid != "" { // if f.uuid != "" {
mutex := GetMutex(f.uuid) // mutex := GetMutex(f.uuid)
mutex.Lock() // mutex.Lock()
defer mutex.Unlock() // defer mutex.Unlock()
} // }
defer func() { defer func() {
err := recover() err := recover()
if err != nil { if err != nil {
@@ -357,11 +357,11 @@ func (f *Factory) SetReplyHandler(function func(map[string]interface{}) string)
func (f *Factory) SetActionHandler(function func(map[string]interface{}) string) { func (f *Factory) SetActionHandler(function func(map[string]interface{}) string) {
f.action = func(m map[string]interface{}) string { f.action = func(m map[string]interface{}) string {
if f.uuid != "" { // if f.uuid != "" {
mutex := GetMutex(f.uuid) // mutex := GetMutex(f.uuid)
mutex.Lock() // mutex.Lock()
defer mutex.Unlock() // defer mutex.Unlock()
} // }
defer func() { defer func() {
err := recover() err := recover()
if err != nil { if err != nil {
+1 -1
View File
@@ -31,7 +31,7 @@ func initNodePlugins() {
root := strings.ReplaceAll(utils.ExecPath+"/plugins", "\\", "/") root := strings.ReplaceAll(utils.ExecPath+"/plugins", "\\", "/")
plugins := []string{root} plugins := []string{root}
os.Mkdir(root, 0755) os.Mkdir(root, 0755)
fmt.Println("root", root) // fmt.Println("root", root)
files, _ := ioutil.ReadDir(root) files, _ := ioutil.ReadDir(root)
for _, file := range files { for _, file := range files {
+1 -1
View File
@@ -179,7 +179,7 @@ func initPlugins() {
} }
} }
return &storage.Final{ return &storage.Final{
Error: errors.New("非法操作"), Error: errors.New("安装失败!!"),
} }
} }