From 7b294d2443b8b841bc428a5d740b3b9c2ce8c52a Mon Sep 17 00:00:00 2001 From: 1-6 Date: Sun, 30 Jul 2023 19:36:31 +0800 Subject: [PATCH] x --- core/function.go | 2 +- core/grpc_plugins.go | 2 +- core/grpc_runtime.go | 2 +- core/plugin_core.go | 10 ++++++---- core/task.go | 2 +- core/web.go | 8 ++++---- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/core/function.go b/core/function.go index 84234b2..5f585a8 100644 --- a/core/function.go +++ b/core/function.go @@ -377,7 +377,7 @@ func AddCommand(cmds []*common.Function) { if cmds[j].OnStart && !cmds[j].Disable { go func(f *common.Function) { time.Sleep(time.Second) - console.Log("初始化%v服务", f.Title) + // console.Log("初始化%v服务", f.Title) f.Handle(&CustomSender{ F: &Factory{ botplt: "*", diff --git a/core/grpc_plugins.go b/core/grpc_plugins.go index b50ae37..55e3e6b 100644 --- a/core/grpc_plugins.go +++ b/core/grpc_plugins.go @@ -318,7 +318,7 @@ func AddNodePlugin(path, name string) error { for _, cb := range cbs { cb() } - if !f.OnStart { + if !f.Disable { //!f.OnStart && if rf == nil { console.Log("已加载 %s%s", f.Title, f.Suffix) } else { diff --git a/core/grpc_runtime.go b/core/grpc_runtime.go index cfbcbe3..c181440 100644 --- a/core/grpc_runtime.go +++ b/core/grpc_runtime.go @@ -77,7 +77,7 @@ func deleteSenderRegister(runtime_id string) { if ok { sm := v.(*sync.Map) sm.Range(func(key, value any) bool { - fmt.Println(key) + // fmt.Println(key) sm.Delete(key) return true }) diff --git a/core/plugin_core.go b/core/plugin_core.go index 1a4b793..42080ee 100644 --- a/core/plugin_core.go +++ b/core/plugin_core.go @@ -350,10 +350,12 @@ func initPlugins() { storage.DisableHandle(key) if new != "" { AddCommand([]*common.Function{f}) - if old == "" { - console.Log("已加载 %s%s", f.Title, f.Suffix) - } else if !f.OnStart { - console.Log("已重载 %s%s", f.Title, f.Suffix) + if !f.Disable { + if old == "" { + console.Log("已加载 %s%s", f.Title, f.Suffix) + } else { //if !f.OnStart + console.Log("已重载 %s%s", f.Title, f.Suffix) + } } } else { of, _, _ := initPlugin(old, key, "") diff --git a/core/task.go b/core/task.go index 2f657ab..c543092 100644 --- a/core/task.go +++ b/core/task.go @@ -83,7 +83,7 @@ func RegistTasks(pt *Tasks) { } cid, _ := CRON.AddFunc(pt.Schedule, pt.Handle) pt.CronID = int(cid) - console.Debug("已添加计划任务:%s(%v)", pt.Title, pt.CronID) + // console.Debug("已添加计划任务:%s(%v)", pt.Title, pt.CronID) } func init() { diff --git a/core/web.go b/core/web.go index ac5bb87..007f4d1 100644 --- a/core/web.go +++ b/core/web.go @@ -182,9 +182,9 @@ func initWeb() { } }) Server.NoRoute(func(c *gin.Context) { - if c.Request.URL.Path != "/api/web_chat" { - logs.Debug(c.Request.URL.Path) - } + // if c.Request.URL.Path != "/api/web_chat" { + // logs.Debug(c.Request.URL.Path) + // } c.Status(200) if strings.HasPrefix(c.Request.URL.Path, "/admin") { if file, err := static.Open(strings.Trim(c.Request.URL.Path, "/")); err == nil { @@ -436,7 +436,7 @@ func initWeb() { return nil } port := new - console.Log("port", new) + // console.Log("port", new) srv := &http.Server{ Addr: ":" + port, Handler: Server,