aa
This commit is contained in:
@@ -194,10 +194,10 @@ func GetAndStoreCitiesShops(ctx *jxcontext.Context, vendorIDs []int, cityCodeLis
|
||||
globals.SugarLogger.Debugf("process city:%d", cityCode)
|
||||
shopList, err := GetCityShops(ctx, task, vendorIDs, cityCode, radius, gridWith)
|
||||
if err == nil {
|
||||
dao.Begin(db)
|
||||
txDB , _ := dao.Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
dao.Rollback(db)
|
||||
dao.Rollback(db, txDB)
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
@@ -216,10 +216,10 @@ func GetAndStoreCitiesShops(ctx *jxcontext.Context, vendorIDs []int, cityCodeLis
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
dao.Rollback(db)
|
||||
dao.Rollback(db, txDB)
|
||||
} else {
|
||||
hint = utils.Int2Str(len(shopList))
|
||||
dao.Commit(db)
|
||||
dao.Commit(db, txDB)
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("process city:%d, len(shopList):%d, err:%v", cityCode, len(shopList), err)
|
||||
|
||||
Reference in New Issue
Block a user