Limit the number of tasks moved by CheckAndEnqueue to prevent a long

running script
This commit is contained in:
Ken Hibino
2020-06-07 13:04:27 -07:00
parent 8af4cbad51
commit 06c4a1c7f8
13 changed files with 91 additions and 105 deletions

View File

@@ -32,9 +32,16 @@ type Stats struct {
// Queue represents a task queue.
type Queue struct {
Name string
// Name of the queue (e.g. "default", "critical").
// Note: It doesn't include the prefix "asynq:queues:".
Name string
// Paused indicates whether the queue is paused.
// If true, tasks in the queue should not be processed.
Paused bool
Size int // number of tasks in the queue
// Size is the number of tasks in the queue.
Size int
}
// DailyStats holds aggregate data for a given day.