request.WithTimeout
This commit is contained in:
parent
da92e535bb
commit
2fa0d7f62e
|
|
@ -39,7 +39,7 @@ var CacheKeyMap = map[CacheKey]time.Duration{
|
||||||
OrderConsumeFailAlarmKey: 2 * time.Hour, // 2小时
|
OrderConsumeFailAlarmKey: 2 * time.Hour, // 2小时
|
||||||
OrderConsumeFailAlarmLockKey: 60 * time.Second,
|
OrderConsumeFailAlarmLockKey: 60 * time.Second,
|
||||||
NotifyRetryConsume: 60 * time.Second,
|
NotifyRetryConsume: 60 * time.Second,
|
||||||
WechatNotifyRegisterTagCacheKey: 30 * 86400 * time.Second, // 5天
|
WechatNotifyRegisterTagCacheKey: 30 * 86400 * time.Second, // 30天
|
||||||
WechatNotifyRegisterTagCacheLockKey: 60 * time.Second,
|
WechatNotifyRegisterTagCacheLockKey: 60 * time.Second,
|
||||||
WechatNotifyConsumeLockKey: 30 * time.Second,
|
WechatNotifyConsumeLockKey: 30 * time.Second,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"github.com/wechatpay-apiv3/wechatpay-go/services/cashcoupons"
|
"github.com/wechatpay-apiv3/wechatpay-go/services/cashcoupons"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
err2 "voucher/api/err"
|
err2 "voucher/api/err"
|
||||||
"voucher/internal/biz/bo"
|
"voucher/internal/biz/bo"
|
||||||
"voucher/internal/biz/vo"
|
"voucher/internal/biz/vo"
|
||||||
|
|
@ -218,6 +219,7 @@ func (c *CpnRepoImpl) RegisterNotifyTag(ctx context.Context, stockID string) err
|
||||||
body,
|
body,
|
||||||
request.WithHeaders(h),
|
request.WithHeaders(h),
|
||||||
request.WithStatusCodeFunc(isSuccess),
|
request.WithStatusCodeFunc(isSuccess),
|
||||||
|
request.WithTimeout(time.Second*20),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue