forked from lxh/go-wxhelper
Merge pull request 'hotfix' (#33) from hotfix into main
Reviewed-on: lxh/go-wxhelper#33
This commit is contained in:
commit
22c7d3683b
@ -37,6 +37,8 @@ task:
|
||||
|
||||
# MQ配置
|
||||
mq:
|
||||
# 是否启用
|
||||
enable: false
|
||||
# RabbitMQ配置
|
||||
rabbitmq:
|
||||
host: 10.0.0.247
|
||||
|
@ -5,6 +5,7 @@ import "fmt"
|
||||
// mq
|
||||
// @description: MQ配置
|
||||
type mq struct {
|
||||
Enable bool `json:"enable" yaml:"enable"` // 是否启用
|
||||
RabbitMQ rabbitMq `json:"rabbitmq" yaml:"rabbitmq"` // RabbitMQ配置
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,10 @@ const exchangeName = "wechat-message"
|
||||
// Init
|
||||
// @description: 初始化MQ
|
||||
func Init() {
|
||||
if !config.Conf.Mq.Enable {
|
||||
log.Println("未启用MQ")
|
||||
return
|
||||
}
|
||||
// 读取MQ连接配置
|
||||
mqUrl := config.Conf.Mq.RabbitMQ.GetURL()
|
||||
if mqUrl == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user