This commit is contained in:
parent
17afd86f85
commit
508a838f2f
|
|
@ -83,7 +83,7 @@ cron:
|
||||||
commandMap:
|
commandMap:
|
||||||
orderNotice:
|
orderNotice:
|
||||||
isOpen: false #是否启动 true/false
|
isOpen: false #是否启动 true/false
|
||||||
command: "0 1 * * *" # 每天凌晨1点执行一次:0 2 * * * | "0 */10 * * *" #cron表达式,每10分钟执行一次
|
command: "0 0 1 * * ?" # 每天凌晨1点执行一次
|
||||||
|
|
||||||
#配置日志
|
#配置日志
|
||||||
logs:
|
logs:
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ cron:
|
||||||
commandMap:
|
commandMap:
|
||||||
orderNotice:
|
orderNotice:
|
||||||
isOpen: true #是否启动 true/false
|
isOpen: true #是否启动 true/false
|
||||||
command: "0 1 * * *" # 每天凌晨1点执行一次:0 2 * * * | "0 */10 * * *" #cron表达式,每10分钟执行一次
|
command: "0 0 1 * * ?" # 每天凌晨1点执行一次
|
||||||
|
|
||||||
#配置日志
|
#配置日志
|
||||||
logs:
|
logs:
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ func (j *VoucherService) GetNotifyRetryConfig() *mq.ConsumerConfig {
|
||||||
func (j *VoucherService) NotifyRetryConsumer(ctx context.Context, msg *mq.ConsumerMessage) error {
|
func (j *VoucherService) NotifyRetryConsumer(ctx context.Context, msg *mq.ConsumerMessage) error {
|
||||||
|
|
||||||
shardingKey := msg.GetShardingKey()
|
shardingKey := msg.GetShardingKey()
|
||||||
if shardingKey == "" {
|
if len(shardingKey) == 0 {
|
||||||
log.Error("notify retry 消费异常,获取 shardingKey 失败")
|
log.Error("notify retry 消费异常,获取 shardingKey 失败")
|
||||||
return errors.New("orderNotify 消费异常,获取 orderNo 失败")
|
return errors.New("orderNotify 消费异常,获取 orderNo 失败")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,13 @@ func (s *VoucherService) CronOrderNotice(ctx context.Context) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 每五秒: */5 * * * * ?
|
||||||
|
// 每隔1分钟执行一次:"0 */1 * * * ?"
|
||||||
|
// 每天23点执行一次:"0 0 23 * * ?"
|
||||||
|
// 每天凌晨1点执行一次:"0 0 1 * * ?"
|
||||||
|
// 每月1号凌晨1点执行一次:"0 0 1 1 * ?"
|
||||||
|
// 在26分、29分、33分执行一次:"0 26,29,33 * * * ?"
|
||||||
|
// 每天的0点、13点、18点、21点都执行一次:"0 0 0,13,18,21 * * ?"
|
||||||
return s.cron.AddFunc(c.Command, func() {
|
return s.cron.AddFunc(c.Command, func() {
|
||||||
|
|
||||||
s.OrderNotice(ctx)
|
s.OrderNotice(ctx)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue