by Robin at 20241126

This commit is contained in:
Robin 2024-11-26 16:14:20 +08:00
parent 056df14b1c
commit f843490b0f
2 changed files with 12 additions and 0 deletions

View File

@ -86,6 +86,7 @@ func (s *CronService) Init(c any) (exec xxl.Executor, err error) {
exec.RegTask("clear_expired_btcb", s.ClearExpiredBtcb)
exec.RegTask("reload_blocked_from_being_searched_list", s.ReloadBlockedFromBeingSearchedList)
exec.RegTask("clear_auto_response_create_times", s.ClearAutoResponseCreateTimes)
exec.RegTask("clear_veri_code_wrong_times", s.ClearVeriCodeWrongTimes)
exec.LogHandler(customLogHandle)
//注册任务handler

View File

@ -607,3 +607,14 @@ func (s *CronService) ClearAutoResponseCreateTimes(ctx context.Context, param *x
logger.Info("auto_response_create_times collection has been cleared")
return "auto_response_create_times collection has been cleared"
}
func (s *CronService) ClearVeriCodeWrongTimes(ctx context.Context, param *xxl.RunReq) (msg string) {
logger.Info("task %v param: %v log_id: %v", param.ExecutorHandler, param.ExecutorParams, xxl.Int64ToStr(param.LogID))
logger.Info("Clearing vericode_wrong_times collection...")
if err := _DefaultVeriCodeWrongTimes.OpClear(&gin.Context{}); err != nil {
logger.Error("Clear vericode_wrong_times collection fail: %v", err)
return fmt.Sprintf("Clear vericode_wrong_times collection fail: %v", err)
}
logger.Info("vericode_wrong_times collection has been cleared")
return "vericode_wrong_times collection has been cleared"
}