更新MongoDB配置并优化Redis客户端调用方式
This commit is contained in:
24
main.go
24
main.go
@@ -6,15 +6,11 @@ import (
|
||||
"oss/service"
|
||||
"time"
|
||||
|
||||
"gitea.com/red-future/common/db/mongo"
|
||||
"gitea.com/red-future/common/log/consts"
|
||||
"gitea.com/red-future/common/message"
|
||||
"github.com/gogf/gf/v2/os/glog"
|
||||
"github.com/gogf/gf/v2/os/gtimer"
|
||||
|
||||
"gitea.com/red-future/common/http"
|
||||
"gitea.com/red-future/common/jaeger"
|
||||
logService "gitea.com/red-future/common/log/service"
|
||||
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
||||
)
|
||||
|
||||
@@ -35,16 +31,16 @@ func main() {
|
||||
})
|
||||
|
||||
// 启动消息队列消费者
|
||||
if err := message.StartConsumers(ctx, &message.RedisMessageConfig{
|
||||
StreamKey: mongo.LogRedisKey,
|
||||
GroupName: consts.GroupName,
|
||||
ConsumerName: consts.ConsumerName,
|
||||
BatchSize: consts.BatchSize,
|
||||
AutoAck: consts.AutoAck,
|
||||
HandleFunc: logService.OperationLog.AddOperationLog,
|
||||
}); err != nil {
|
||||
return
|
||||
}
|
||||
//if err := message.StartConsumers(ctx, &message.RedisMessageConfig{
|
||||
// StreamKey: mongo.LogRedisKey,
|
||||
// GroupName: consts.GroupName,
|
||||
// ConsumerName: consts.ConsumerName,
|
||||
// BatchSize: consts.BatchSize,
|
||||
// AutoAck: consts.AutoAck,
|
||||
// HandleFunc: logService.OperationLog.AddOperationLog,
|
||||
//}); err != nil {
|
||||
// return
|
||||
//}
|
||||
|
||||
// 保持应用运行
|
||||
select {}
|
||||
|
||||
Reference in New Issue
Block a user