From faa43fef5a605fde49e6a0740e8befd1f5753f24 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 8 Jul 2019 15:17:27 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E9=97=A8=E5=BA=97=E7=88=AC=E8=99=AB?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B0=83=E8=AF=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/netspider/netspider.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/business/netspider/netspider.go b/business/netspider/netspider.go index c8bf7db23..642401b67 100644 --- a/business/netspider/netspider.go +++ b/business/netspider/netspider.go @@ -29,6 +29,7 @@ func GetCityShops(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs [] if err = err2; err == nil { retVal = storeList } + globals.SugarLogger.Debugf("GetCityShops vendorID:%d, cityCode:%d, len(storeList):%d, err:%v", vendorID, cityCode, len(storeList), err) return retVal, err }, vendorIDs) tasksch.AddChild(parentTask, task).Run() @@ -124,11 +125,13 @@ func GetAndStoreCitiesShops(ctx *jxcontext.Context, vendorIDs []int, cityCodeLis task := tasksch.NewSeqTask("GetAndStoreCitiesShops", ctx, func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) { cityCode := cityCodeList[step] + globals.SugarLogger.Debugf("process city:%d", cityCode) shopList, err := GetCityShops(ctx, task, vendorIDs, cityCode, radius, gridWith) if err == nil { dao.Begin(db) defer func() { if r := recover(); r != nil { + panic(r) dao.Rollback(db) } }() @@ -145,6 +148,7 @@ func GetAndStoreCitiesShops(ctx *jxcontext.Context, vendorIDs []int, cityCodeLis dao.Commit(db) } } + globals.SugarLogger.Debugf("process city:%d, len(shopList):%d, err:%v", cityCode, len(shopList), err) return nil, nil // 强制继续 }, len(cityCodeList)) tasksch.ManageTask(task).Run()