WechatQuery
This commit is contained in:
parent
b70eda503b
commit
11ff1c8540
|
|
@ -26,11 +26,11 @@ func NewRdbConsumer(
|
|||
) *RdbConsumer {
|
||||
manager := rdsmq.NewConsumerManager()
|
||||
|
||||
if cf := voucherService.GetConfig(); cf != nil {
|
||||
if cf := voucherService.GetWechatQueryConfig(); cf != nil {
|
||||
manager.Add(cf)
|
||||
}
|
||||
|
||||
if cf2 := voucherService.GetWechatConfig(); cf2 != nil {
|
||||
if cf2 := voucherService.GetWechatRetryConfig(); cf2 != nil {
|
||||
manager.Add(cf2)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"voucher/internal/pkg/rdsmq"
|
||||
)
|
||||
|
||||
func (s *VoucherService) GetConfig() *rdsmq.ConsumeConfig {
|
||||
func (s *VoucherService) GetWechatQueryConfig() *rdsmq.ConsumeConfig {
|
||||
|
||||
queue := s.bc.RdsMQ.GetWechatQuery()
|
||||
if queue == nil {
|
||||
|
|
@ -25,12 +25,12 @@ func (s *VoucherService) GetConfig() *rdsmq.ConsumeConfig {
|
|||
NumWorkers: queue.NumWorkers,
|
||||
WaitTime: queue.GetWaitTime().AsDuration(),
|
||||
RetryNum: queue.RetryNum,
|
||||
Fn: s.Handle,
|
||||
Fn: s.WechatQueryHandle,
|
||||
Logger: s.logHelper,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *VoucherService) Handle(ctx context.Context, batchNo string) error {
|
||||
func (s *VoucherService) WechatQueryHandle(ctx context.Context, batchNo string) error {
|
||||
|
||||
if batchNo == "" {
|
||||
s.logHelper.Errorf("wechat query error: batchNo is empty")
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"voucher/internal/pkg/rdsmq"
|
||||
)
|
||||
|
||||
func (s *VoucherService) GetWechatConfig() *rdsmq.ConsumeConfig {
|
||||
func (s *VoucherService) GetWechatRetryConfig() *rdsmq.ConsumeConfig {
|
||||
|
||||
queue := s.bc.RdsMQ.GetWechatRetry()
|
||||
if queue == nil {
|
||||
|
|
@ -25,12 +25,12 @@ func (s *VoucherService) GetWechatConfig() *rdsmq.ConsumeConfig {
|
|||
NumWorkers: queue.NumWorkers,
|
||||
WaitTime: queue.GetWaitTime().AsDuration(),
|
||||
RetryNum: queue.RetryNum,
|
||||
Fn: s.HandleWechat,
|
||||
Fn: s.HandleWechatRetry,
|
||||
Logger: s.logHelper,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *VoucherService) HandleWechat(ctx context.Context, batchNo string) error {
|
||||
func (s *VoucherService) HandleWechatRetry(ctx context.Context, batchNo string) error {
|
||||
|
||||
if batchNo == "" {
|
||||
s.logHelper.Errorf("RdsMQ keySend error: batchNo is empty")
|
||||
|
|
|
|||
Loading…
Reference in New Issue