Commit 0f7d1c1a by hcy

并发问题

parent 01398960
Showing with 14 additions and 11 deletions
......@@ -2,14 +2,14 @@
[default_redis_read]
host = redis.liexindev.me:6379
password = icDb29mLy2s
max_idle = 2000
max_idle = 5000
max_active = 5000
idle_timeout = 20
[default_redis_write]
host = redis.liexindev.me:6379
password = icDb29mLy2s
max_idle = 2000
max_idle = 5000
max_active = 5000
idle_timeout = 20
......
......@@ -165,19 +165,21 @@ func (ss *SpuService) SetInit(redisLySkuArr, redisLySpuArr map[string]string, zy
//批量获取标签b
GoodsLabelTags = gredis.Hmget("default_r", "goods_label_tags", []string{"0", "1", "2", "3", "4", "5", "6"})
var wg sync.WaitGroup
//BatchErpTax(erpMd5Key) //批量查询品牌
var wg sync.WaitGroup
//
wg.Add(1)
go func() {
defer wg.Done()
BatchLyClassName(ClassIds) //批量查询分类
}()
wg.Add(1)
go func() {
defer wg.Done()
BatchErpTax(erpMd5Key) //批量查询品牌
}()
//
//wg.Add(1)
//go func() {
// defer wg.Done()
// BatchErpTax(erpMd5Key) //批量查询品牌
//}()
wg.Add(1)
go func() {
......@@ -231,12 +233,13 @@ func BatchErpTax(upmd5Str []string) {
AllErpTax = make(map[string]interface{}, 0)
for md5k, info := range taxArr {
data := make(map[string]interface{})
AllErpTax[md5k] = false
if info != "" {
if gjson.Get(info, "tax_rate_low").String() != "" || gjson.Get(info, "supervision_con").Int() > 0 {
data["tariffRate"] = gjson.Get(info, "tax_rate_low").String()
data["types"] = gjson.Get(info, "supervision_con").String()
AllErpTax[md5k] = data
} else {
AllErpTax[md5k] = false
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment