Commit 0f7d1c1a by hcy

并发问题

parent 01398960
Showing with 18 additions and 15 deletions
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
[default_redis_read] [default_redis_read]
host = redis.liexindev.me:6379 host = redis.liexindev.me:6379
password = icDb29mLy2s password = icDb29mLy2s
max_idle = 2000 max_idle = 5000
max_active = 5000 max_active = 5000
idle_timeout = 20 idle_timeout = 20
[default_redis_write] [default_redis_write]
host = redis.liexindev.me:6379 host = redis.liexindev.me:6379
password = icDb29mLy2s password = icDb29mLy2s
max_idle = 2000 max_idle = 5000
max_active = 5000 max_active = 5000
idle_timeout = 20 idle_timeout = 20
......
...@@ -165,19 +165,21 @@ func (ss *SpuService) SetInit(redisLySkuArr, redisLySpuArr map[string]string, zy ...@@ -165,19 +165,21 @@ func (ss *SpuService) SetInit(redisLySkuArr, redisLySpuArr map[string]string, zy
//批量获取标签b //批量获取标签b
GoodsLabelTags = gredis.Hmget("default_r", "goods_label_tags", []string{"0", "1", "2", "3", "4", "5", "6"}) 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) wg.Add(1)
go func() { go func() {
defer wg.Done() defer wg.Done()
BatchLyClassName(ClassIds) //批量查询分类 BatchLyClassName(ClassIds) //批量查询分类
}() }()
//
wg.Add(1) //wg.Add(1)
go func() { //go func() {
defer wg.Done() // defer wg.Done()
BatchErpTax(erpMd5Key) //批量查询品牌 // BatchErpTax(erpMd5Key) //批量查询品牌
}() //}()
wg.Add(1) wg.Add(1)
go func() { go func() {
...@@ -231,12 +233,13 @@ func BatchErpTax(upmd5Str []string) { ...@@ -231,12 +233,13 @@ func BatchErpTax(upmd5Str []string) {
AllErpTax = make(map[string]interface{}, 0) AllErpTax = make(map[string]interface{}, 0)
for md5k, info := range taxArr { for md5k, info := range taxArr {
data := make(map[string]interface{}) data := make(map[string]interface{})
if gjson.Get(info, "tax_rate_low").String() != "" || gjson.Get(info, "supervision_con").Int() > 0 { AllErpTax[md5k] = false
data["tariffRate"] = gjson.Get(info, "tax_rate_low").String() if info != "" {
data["types"] = gjson.Get(info, "supervision_con").String() if gjson.Get(info, "tax_rate_low").String() != "" || gjson.Get(info, "supervision_con").Int() > 0 {
AllErpTax[md5k] = data data["tariffRate"] = gjson.Get(info, "tax_rate_low").String()
} else { data["types"] = gjson.Get(info, "supervision_con").String()
AllErpTax[md5k] = false AllErpTax[md5k] = data
}
} }
} }
} }
......
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