feat(task-queue): split upstream workers into isolated core/enrichment/maintenance pools
Route summary/sync/maintenance tasks to dedicated queues and servers so parsing, enrichment, and batch work no longer share one concurrency budget, while extending the runtime dashboard and settings validation to reflect the new topology.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package service
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestValidateWorkerConcurrencyMinimums(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
key string
|
||||
value any
|
||||
wantErr bool
|
||||
}{
|
||||
{name: "upstream below one worker per pool", key: "asynq.concurrency", value: 2, wantErr: true},
|
||||
{name: "upstream minimum", key: "asynq.concurrency", value: 3},
|
||||
{name: "upstream normal", key: "asynq.concurrency", value: 32},
|
||||
{name: "wiki zero", key: "asynq.wiki_concurrency", value: 0, wantErr: true},
|
||||
{name: "wiki minimum", key: "asynq.wiki_concurrency", value: 1},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
err := validateRegistryEntry(tt.key, tt.value)
|
||||
if tt.wantErr && err == nil {
|
||||
t.Fatal("expected validation error")
|
||||
}
|
||||
if !tt.wantErr && err != nil {
|
||||
t.Fatalf("unexpected validation error: %v", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user