mirror of
https://github.com/AlistGo/alist.git
synced 2025-06-04 17:04:42 +08:00
feat: post messenger
This commit is contained in:
@ -2,7 +2,9 @@ package data
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/alist-org/alist/v3/cmd/args"
|
||||
"github.com/alist-org/alist/v3/internal/db"
|
||||
"github.com/alist-org/alist/v3/internal/message"
|
||||
"github.com/alist-org/alist/v3/internal/model"
|
||||
"github.com/alist-org/alist/v3/internal/operations"
|
||||
log "github.com/sirupsen/logrus"
|
||||
@ -30,3 +32,23 @@ func initDevData() {
|
||||
log.Fatalf("failed to create user: %+v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func initDevDo() {
|
||||
if args.Dev {
|
||||
go func() {
|
||||
err := message.GetMessenger().WaitSend(map[string]string{
|
||||
"type": "dev",
|
||||
"msg": "dev mode",
|
||||
}, 10)
|
||||
if err != nil {
|
||||
log.Debugf("%+v", err)
|
||||
}
|
||||
m, err := message.GetMessenger().WaitReceive(10)
|
||||
if err != nil {
|
||||
log.Debugf("%+v", err)
|
||||
} else {
|
||||
log.Debugf("received: %+v", m)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user