mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 15:26:36 +08:00
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:
@@ -71,6 +71,14 @@ type TaskExecutionDTO struct {
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// Canonical triggered_by values persisted on task executions and shown in admin UI.
|
||||
const (
|
||||
TaskTriggerSystem = "system"
|
||||
TaskTriggerManual = "manual"
|
||||
TaskTriggerRetry = "retry"
|
||||
TaskTriggerSchedule = "schedule"
|
||||
)
|
||||
|
||||
// TaskService defines the unified contract for dispatching and tracking background tasks.
|
||||
type TaskService interface {
|
||||
Dispatch(ctx context.Context, taskType string, payload []byte, triggeredBy string) (string, error)
|
||||
|
||||
Reference in New Issue
Block a user