fix(tasks): canonicalize triggered_by so execution labels resolve

Unknown values such as http and inproc_cron made the admin UI call
t(undefined). Dispatch sites now write system/manual/retry/schedule,
the list API maps legacy rows, and the table skips missing i18n keys.
This commit is contained in:
ryan
2026-09-02 18:04:32 +08:00
parent 1f1f4efec7
commit df7ad453cc
9 changed files with 90 additions and 16 deletions
+1 -1
View File
@@ -209,7 +209,7 @@ func SendEmailCode(c *gin.Context) {
}
ctx := c.Request.Context()
if taskSvc := getTaskService(ctx); taskSvc != nil {
if _, err := taskSvc.Dispatch(ctx, TaskTypeSendEmailCode, payload, "http"); err != nil {
if _, err := taskSvc.Dispatch(ctx, TaskTypeSendEmailCode, payload, contracts.TaskTriggerSystem); err != nil {
logger.ErrorF(ctx, "dispatch send_email_code failed: %v", err)
response.AbortInternal(c, errSendEmailFailed)
return