|
@@ -80,7 +80,10 @@ func (im *InvoiceManager) simpleMakeInvoice(ctx context.Context) (total, okNum i
|
|
|
|
|
|
err = im.Auth.MakeSingleInvoice(c)
|
|
err = im.Auth.MakeSingleInvoice(c)
|
|
if err != nil {
|
|
if err != nil {
|
|
- <-im.RunPool
|
|
|
|
|
|
+ select {
|
|
|
|
+ case <-im.RunPool:
|
|
|
|
+ case <-time.After(time.Second * 5):
|
|
|
|
+ }
|
|
if gerror.Is(err, consts.LoginOutErr) {
|
|
if gerror.Is(err, consts.LoginOutErr) {
|
|
end = true
|
|
end = true
|
|
g.Log().Infof(ctx, "simpleMakeInvoice-身份过期,需要重新登录")
|
|
g.Log().Infof(ctx, "simpleMakeInvoice-身份过期,需要重新登录")
|
|
@@ -162,7 +165,10 @@ func (im *InvoiceManager) multipleOrdersMakeInvoice(ctx context.Context) (total,
|
|
|
|
|
|
err = im.Auth.MakeSingleInvoice(c)
|
|
err = im.Auth.MakeSingleInvoice(c)
|
|
if err != nil {
|
|
if err != nil {
|
|
- <-im.RunPool
|
|
|
|
|
|
+ select {
|
|
|
|
+ case <-im.RunPool:
|
|
|
|
+ case <-time.After(time.Second * 5):
|
|
|
|
+ }
|
|
if gerror.Is(err, consts.LoginOutErr) {
|
|
if gerror.Is(err, consts.LoginOutErr) {
|
|
g.Log().Infof(ctx, "multipleOrdersMakeInvoice-身份过期,需要重新登录")
|
|
g.Log().Infof(ctx, "multipleOrdersMakeInvoice-身份过期,需要重新登录")
|
|
end = true
|
|
end = true
|
|
@@ -208,7 +214,10 @@ func (im *InvoiceManager) makeRedInvoice(ctx context.Context) (total, okNum int,
|
|
Date: invoiceDate.Format(consts.DateFormat_Short),
|
|
Date: invoiceDate.Format(consts.DateFormat_Short),
|
|
})
|
|
})
|
|
if err != nil {
|
|
if err != nil {
|
|
- <-im.RunPool
|
|
|
|
|
|
+ select {
|
|
|
|
+ case <-im.RunPool:
|
|
|
|
+ case <-time.After(time.Second * 5):
|
|
|
|
+ }
|
|
if gerror.Is(err, consts.LoginOutErr) {
|
|
if gerror.Is(err, consts.LoginOutErr) {
|
|
g.Log().Infof(ctx, "makeRedInvoice-身份过期,需要重新登录")
|
|
g.Log().Infof(ctx, "makeRedInvoice-身份过期,需要重新登录")
|
|
end = true
|
|
end = true
|
|
@@ -249,7 +258,10 @@ func (im *InvoiceManager) multipleOrdersMakeRedInvoice(ctx context.Context) (tot
|
|
Date: invoiceDate.Format(consts.DateFormat_Short),
|
|
Date: invoiceDate.Format(consts.DateFormat_Short),
|
|
})
|
|
})
|
|
if err != nil {
|
|
if err != nil {
|
|
- <-im.RunPool
|
|
|
|
|
|
+ select {
|
|
|
|
+ case <-im.RunPool:
|
|
|
|
+ case <-time.After(time.Second * 5):
|
|
|
|
+ }
|
|
if gerror.Is(err, consts.LoginOutErr) {
|
|
if gerror.Is(err, consts.LoginOutErr) {
|
|
g.Log().Infof(ctx, "multipleOrdersMakeRedInvoice-身份过期,需要重新登录")
|
|
g.Log().Infof(ctx, "multipleOrdersMakeRedInvoice-身份过期,需要重新登录")
|
|
end = true
|
|
end = true
|