Merge pull request 'feat-IRONFANS-70' (#270) from feat-IRONFANS-70 into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/270
This commit is contained in:
chenhao 2024-04-11 19:37:30 +08:00
commit 961d76e685
2 changed files with 12 additions and 0 deletions

View File

@ -57,6 +57,7 @@ func (s *CronService) Init(c any) (err error) {
exec.RegTask("send_contact_customer_services_of_last_minute", s.SendContactCustomerServicesOfLastMinute)
exec.RegTask("cancel_account_at_due_time", s.CancelAccountsAtDueTime)
exec.RegTask("reload_moment_recomm_list", s.ReloadMomentRecommList)
exec.RegTask("clear_zone_moment_create_times", s.ClearZoneMomentCreateTimes)
exec.LogHandler(customLogHandle)
//注册任务handler

View File

@ -423,3 +423,14 @@ func (s *CronService) ReloadMomentRecommList(ctx context.Context, param *xxl.Run
logger.Info("Refresh moment recommendation list cached in redis accomplished...")
return "Refresh moment recommendation list cached in redis accomplished"
}
func (s *CronService) ClearZoneMomentCreateTimes(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 zone_moment_create_times collection...")
if err := _DefaultZoneMomentCreateTimes.OpClear(&gin.Context{}); err != nil {
logger.Error("Clear zone_moment_create_times collection fail: %v", err)
return fmt.Sprintf("Clear zone_moment_create_times collection fail: %v", err)
}
logger.Info("zone_moment_create_times collection has been cleared")
return "zone_moment_create_times collection has been cleared"
}