Wires the scheduler into the cup application following the exact conventions of the Asynq queue integration #18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "jacs/cup:scheduler"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wires the scheduler into the cup application following the exact conventions of the Asynq queue integration. A new testmac/config/scheduler.go file provides GetSchedulerConfig() with enable flag, polling interval, and rate limit. A new testmac/register-scheduler.go file registers task handlers (send_email and flaky_task as samples) on the Schedulermux, creates the DB-backed store via core.ResolveGorm(), and launches the scheduler in a goroutine — only when EnableScheduler: true. The scheduler tables are migrated alongside other models in run-auto-migrations.go via db.AutoMigrate(&scheduler.QueueItem{}, &scheduler.ProcessedItem{}).