You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the TaskSpec task-registry pattern from §3.1. The map registry[taskType] -> TaskSpec{Type, Queue, MaxRetry, Timeout, RetryDelay, UniqueTTL, Idempotent, HumanName} is the single source of truth for queue assignment, retry policy, timeout, and idempotency strategy. Enqueue API resolves the spec and applies its options unless explicitly overridden. The §3 catalog table is encoded here.
Design reference
docs/12-jobs-cron.md §3 (Task type catalog) and §3.1 (Registry pattern)
Acceptance criteria
internal/jobs/tasktypes.go exports TaskSpec struct and Spec(taskType) (TaskSpec, bool)
Summary
Implement the
TaskSpectask-registry pattern from §3.1. The mapregistry[taskType] -> TaskSpec{Type, Queue, MaxRetry, Timeout, RetryDelay, UniqueTTL, Idempotent, HumanName}is the single source of truth for queue assignment, retry policy, timeout, and idempotency strategy. Enqueue API resolves the spec and applies its options unless explicitly overridden. The §3 catalog table is encoded here.Design reference
Acceptance criteria
internal/jobs/tasktypes.goexportsTaskSpecstruct andSpec(taskType) (TaskSpec, bool)email.send,email.password_reset,email.verify,email.comment_notify,webhook.deliver,cache.invalidate.tag_fanout,cache.warmup,media.variant.generate,media.video.transcode,media.thumbnail.extract,media.cleanup.orphans,media.cleanup.cold_variants,revalidate.next,migrate.batch.posts/media/users,migrate.verify,audit.archive,auth.session.cleanup,auth.token.cleanup,auth.brute_force.unlock,search.reindex.post/term/comment/full,revisions.purge,autosave.purge,rum.aggregate,plugin.activate/deactivate/uninstall.cleanup,plugin.cron.tick,webhook.retry.dlq.scanexp(base, max)produces the §5.1 jittered exponential backoff funcIdempotentflag drives the compensation requirement in handlersQueue/MaxRetry/Timeout/RetryDelay/UniqueTTL, allows explicit overridesDependencies
#256
Complexity
M