Browse Source

update

order_statistics
dengbiao 6 months ago
parent
commit
681b3157d3
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      consume/one_circles_activity_coin_auto_exchange_green_energy_consume.go

+ 2
- 2
consume/one_circles_activity_coin_auto_exchange_green_energy_consume.go View File

@@ -32,7 +32,7 @@ func OneCirclesActivityCoinAutoExchangeGreenEnergyConsume(queue md.MqQueue) {
//1、将自己绑定到交换机上 //1、将自己绑定到交换机上
ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey) ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey)
//2、取出数据进行消费 //2、取出数据进行消费
ch.Qos(50)
ch.Qos(20)
delivery := ch.Consume(queue.Name, false) delivery := ch.Consume(queue.Name, false)


one_circles.Init(cfg.RedisAddr) one_circles.Init(cfg.RedisAddr)
@@ -61,7 +61,7 @@ func OneCirclesActivityCoinAutoExchangeGreenEnergyConsume(queue md.MqQueue) {
} }


func handleOneCirclesActivityCoinAutoExchangeGreenEnergyConsume(msgData []byte) error { func handleOneCirclesActivityCoinAutoExchangeGreenEnergyConsume(msgData []byte) error {
time.Sleep(time.Duration(1) * time.Millisecond) //休眠1毫秒
time.Sleep(time.Duration(100) * time.Microsecond) //休眠0.1毫秒
//1、解析mq中queue的数据结构体 //1、解析mq中queue的数据结构体
var msg *md2.OneCirclesStructForAutoExchangeGreenEnergy var msg *md2.OneCirclesStructForAutoExchangeGreenEnergy
err := json.Unmarshal(msgData, &msg) err := json.Unmarshal(msgData, &msg)


Loading…
Cancel
Save