This commit is contained in:
1-6
2023-07-30 19:36:31 +08:00
parent 10252911b6
commit 7b294d2443
6 changed files with 14 additions and 12 deletions
+1 -1
View File
@@ -377,7 +377,7 @@ func AddCommand(cmds []*common.Function) {
if cmds[j].OnStart && !cmds[j].Disable { if cmds[j].OnStart && !cmds[j].Disable {
go func(f *common.Function) { go func(f *common.Function) {
time.Sleep(time.Second) time.Sleep(time.Second)
console.Log("初始化%v服务", f.Title) // console.Log("初始化%v服务", f.Title)
f.Handle(&CustomSender{ f.Handle(&CustomSender{
F: &Factory{ F: &Factory{
botplt: "*", botplt: "*",
+1 -1
View File
@@ -318,7 +318,7 @@ func AddNodePlugin(path, name string) error {
for _, cb := range cbs { for _, cb := range cbs {
cb() cb()
} }
if !f.OnStart { if !f.Disable { //!f.OnStart &&
if rf == nil { if rf == nil {
console.Log("已加载 %s%s", f.Title, f.Suffix) console.Log("已加载 %s%s", f.Title, f.Suffix)
} else { } else {
+1 -1
View File
@@ -77,7 +77,7 @@ func deleteSenderRegister(runtime_id string) {
if ok { if ok {
sm := v.(*sync.Map) sm := v.(*sync.Map)
sm.Range(func(key, value any) bool { sm.Range(func(key, value any) bool {
fmt.Println(key) // fmt.Println(key)
sm.Delete(key) sm.Delete(key)
return true return true
}) })
+6 -4
View File
@@ -350,10 +350,12 @@ func initPlugins() {
storage.DisableHandle(key) storage.DisableHandle(key)
if new != "" { if new != "" {
AddCommand([]*common.Function{f}) AddCommand([]*common.Function{f})
if old == "" { if !f.Disable {
console.Log("已加载 %s%s", f.Title, f.Suffix) if old == "" {
} else if !f.OnStart { console.Log("已加载 %s%s", f.Title, f.Suffix)
console.Log("已重载 %s%s", f.Title, f.Suffix) } else { //if !f.OnStart
console.Log("已重载 %s%s", f.Title, f.Suffix)
}
} }
} else { } else {
of, _, _ := initPlugin(old, key, "") of, _, _ := initPlugin(old, key, "")
+1 -1
View File
@@ -83,7 +83,7 @@ func RegistTasks(pt *Tasks) {
} }
cid, _ := CRON.AddFunc(pt.Schedule, pt.Handle) cid, _ := CRON.AddFunc(pt.Schedule, pt.Handle)
pt.CronID = int(cid) pt.CronID = int(cid)
console.Debug("已添加计划任务:%s(%v)", pt.Title, pt.CronID) // console.Debug("已添加计划任务:%s(%v)", pt.Title, pt.CronID)
} }
func init() { func init() {
+4 -4
View File
@@ -182,9 +182,9 @@ func initWeb() {
} }
}) })
Server.NoRoute(func(c *gin.Context) { Server.NoRoute(func(c *gin.Context) {
if c.Request.URL.Path != "/api/web_chat" { // if c.Request.URL.Path != "/api/web_chat" {
logs.Debug(c.Request.URL.Path) // logs.Debug(c.Request.URL.Path)
} // }
c.Status(200) c.Status(200)
if strings.HasPrefix(c.Request.URL.Path, "/admin") { if strings.HasPrefix(c.Request.URL.Path, "/admin") {
if file, err := static.Open(strings.Trim(c.Request.URL.Path, "/")); err == nil { if file, err := static.Open(strings.Trim(c.Request.URL.Path, "/")); err == nil {
@@ -436,7 +436,7 @@ func initWeb() {
return nil return nil
} }
port := new port := new
console.Log("port", new) // console.Log("port", new)
srv := &http.Server{ srv := &http.Server{
Addr: ":" + port, Addr: ":" + port,
Handler: Server, Handler: Server,