⬆️ 更新依赖gitee.ltd/lxh/xybot至v0.0.4,调整消息同步频率至每秒一次
All checks were successful
BuildImage / build-image (push) Successful in 8m20s
All checks were successful
BuildImage / build-image (push) Successful in 8m20s
This commit is contained in:
parent
dd1f9376c5
commit
b839e4991a
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ module gitee.ltd/lxh/wechat-robot
|
||||
go 1.24.0
|
||||
|
||||
require (
|
||||
gitee.ltd/lxh/xybot v0.0.3
|
||||
gitee.ltd/lxh/xybot v0.0.4
|
||||
github.com/docker/docker v28.1.1+incompatible
|
||||
github.com/docker/go-connections v0.5.0
|
||||
github.com/go-co-op/gocron/v2 v2.16.1
|
||||
|
2
go.sum
2
go.sum
@ -2,6 +2,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
gitee.ltd/lxh/xybot v0.0.3 h1:/xRCnW2nMtx/hdV7TdpEcL3Sh8f9oBGHToONk0yGstA=
|
||||
gitee.ltd/lxh/xybot v0.0.3/go.mod h1:jYfEAQ3WPsST/PY4fEEVFjU6KtMocxn3sQi78I+vdxc=
|
||||
gitee.ltd/lxh/xybot v0.0.4 h1:sEs6ZOZud2oDWvW1MVpwHWJUq3AyxYA1G/SGP4En+/0=
|
||||
gitee.ltd/lxh/xybot v0.0.4/go.mod h1:jYfEAQ3WPsST/PY4fEEVFjU6KtMocxn3sQi78I+vdxc=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
|
||||
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
|
||||
|
@ -40,10 +40,12 @@ func syncMessage(client *xybot.Client, robotId uint) {
|
||||
// 没有消息,直接返回
|
||||
return
|
||||
}
|
||||
//log.Debugf("当前同步机器人Id: %d,消息数量: %d,客户端信息: %+v", robotId, len(messages), client)
|
||||
|
||||
// 处理消息
|
||||
var msg []model.Message
|
||||
for _, message := range messages {
|
||||
//log.Debugf("当前同步机器人Id: %d,消息内容: %s", robotId, message.Content.String)
|
||||
var m model.Message
|
||||
m.RobotId = robotId
|
||||
m.MsgId = message.NewMsgId
|
||||
|
@ -53,7 +53,7 @@ func AddJob(robot model.Robot) {
|
||||
}
|
||||
|
||||
job, err := scheduler.NewJob(
|
||||
gocron.CronJob("*/5 * * * * *", true), // 五秒钟同步一次
|
||||
gocron.CronJob("*/1 * * * * *", true), // 1秒钟同步一次
|
||||
gocron.NewTask(syncMessage, robotCli, robot.ID),
|
||||
)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user