- remove many useless isForce parameters.

- isSync to isAsync.
This commit is contained in:
gazebo
2018-10-16 11:52:40 +08:00
parent d7de24715b
commit d7b93b8bf2
10 changed files with 74 additions and 48 deletions

View File

@@ -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()