|
@@ -41,6 +41,10 @@ func init() {
|
|
//初始化三方接口
|
|
//初始化三方接口
|
|
JyInvoiceManager.Auth.CallBackInit()
|
|
JyInvoiceManager.Auth.CallBackInit()
|
|
|
|
|
|
|
|
+ //go func() {
|
|
|
|
+ // time.Sleep(time.Second * 5)
|
|
|
|
+ // JyInvoiceManager.RunRedBatchOnce(context.Background())
|
|
|
|
+ //}()
|
|
//go JyInvoiceManager.RunOneJob(context.Background())//流程
|
|
//go JyInvoiceManager.RunOneJob(context.Background())//流程
|
|
//go JyInvoiceManager.Demo(context.Background()) //开票
|
|
//go JyInvoiceManager.Demo(context.Background()) //开票
|
|
//go JyInvoiceManager.Auth.Login() //登录
|
|
//go JyInvoiceManager.Auth.Login() //登录
|
|
@@ -153,6 +157,15 @@ func (im *InvoiceManager) RunJob(ctx context.Context) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //保证所有回调已执行完成
|
|
|
|
+ select {
|
|
|
|
+ case im.RunPool <- true:
|
|
|
|
+ case <-time.After(time.Minute * 5):
|
|
|
|
+ g.Log().Infof(ctx, "RunJob-等待回调完成超时")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ <-im.RunPool
|
|
|
|
+
|
|
g.Log().Infof(ctx, "RunJob-multipleOrdersMakeRedInvoice任务完成 共%d个 完成%d个", total, okNum)
|
|
g.Log().Infof(ctx, "RunJob-multipleOrdersMakeRedInvoice任务完成 共%d个 完成%d个", total, okNum)
|
|
}
|
|
}
|
|
|
|
|