From 8239f726b3dde50475a43dd5d83f07145d4f100b Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 1 Nov 2018 09:31:19 +0800 Subject: [PATCH] - .SetIsContinueWhenError(true) in SendFilesToStores --- business/jxstore/financial/financial.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/business/jxstore/financial/financial.go b/business/jxstore/financial/financial.go index db30cdd30..5775dbe1c 100644 --- a/business/jxstore/financial/financial.go +++ b/business/jxstore/financial/financial.go @@ -52,7 +52,7 @@ func SendFilesToStores(ctx *jxcontext.Context, files []*multipart.FileHeader, is } upToken := putPolicy.UploadToken(api.QiniuAPI) cfg := &storage.Config{} - task := tasksch.NewParallelTask("SendFilesToStores", nil, userName, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { + task := tasksch.NewParallelTask("SendFilesToStores", tasksch.NewParallelConfig().SetIsContinueWhenError(true), userName, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { fileInfo := batchItemList[0].(*tUploadFileInfo) fileHeader := fileInfo.FileHeader storeID := fileInfo.StoreID @@ -78,6 +78,10 @@ func SendFilesToStores(ctx *jxcontext.Context, files []*multipart.FileHeader, is } if err = dao.CreateEntity(db, billRec); err == nil { err = weixinmsg.NotifySaleBill(storeID, "http://www2.jxc4.com/jx/public/index.php/jd/excel/index?path="+billRec.Url) + if err != nil { + globals.SugarLogger.Infof("SendFilesToStores NotifySaleBill file:%s error:%v", fileHeader.Filename, err) + } + err = nil // 忽略微信发送错误 } else { globals.SugarLogger.Warnf("SendFilesToStores CreateEntity file:%s error:%v", fileHeader.Filename, err) }