- remove many useless isForce parameters.
- isSync to isAsync.
This commit is contained in:
@@ -71,17 +71,17 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func (p *PurchaseHandler) SyncStoresSkus(db *dao.DaoDB, storeIDs []int, skuIDs []int, isSync bool, userName string) (err error) {
|
||||
func (p *PurchaseHandler) SyncStoresSkus(db *dao.DaoDB, storeIDs []int, skuIDs []int, isAsync bool, userName string) (hint string, err error) {
|
||||
for _, storeID := range storeIDs {
|
||||
err = p.syncOneStoreSkus(db, storeID, skuIDs, isSync, userName)
|
||||
err = p.syncOneStoreSkus(db, storeID, skuIDs, isAsync, userName)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
return err
|
||||
return hint, err
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) syncOneStoreSkus(db *dao.DaoDB, storeID int, skuIDs []int, isSync bool, userName string) (err error) {
|
||||
func (p *PurchaseHandler) syncOneStoreSkus(db *dao.DaoDB, storeID int, skuIDs []int, isAsync bool, userName string) (err error) {
|
||||
globals.SugarLogger.Debugf("syncOneStoreSkus storeID:%d, skuIDs:%v, userName:%s", storeID, skuIDs, userName)
|
||||
|
||||
doThing := func() (err error) {
|
||||
@@ -172,7 +172,7 @@ func (p *PurchaseHandler) syncOneStoreSkus(db *dao.DaoDB, storeID int, skuIDs []
|
||||
}
|
||||
return err
|
||||
}
|
||||
if isSync {
|
||||
if !isAsync {
|
||||
err = doThing()
|
||||
} else {
|
||||
go doThing()
|
||||
|
||||
Reference in New Issue
Block a user