forked from forgejo/forgejo
Queue: Make resizing worker pools
This commit is contained in:
parent
0edb70a099
commit
e6ebb47299
11 changed files with 543 additions and 363 deletions
|
@ -27,9 +27,13 @@ func TestLevelQueue(t *testing.T) {
|
|||
var queueTerminate func()
|
||||
|
||||
queue, err := NewLevelQueue(handle, LevelQueueConfiguration{
|
||||
DataDir: "level-queue-test-data",
|
||||
BatchLength: 2,
|
||||
Workers: 1,
|
||||
DataDir: "level-queue-test-data",
|
||||
BatchLength: 2,
|
||||
Workers: 1,
|
||||
QueueLength: 20,
|
||||
BlockTimeout: 1 * time.Second,
|
||||
BoostTimeout: 5 * time.Minute,
|
||||
BoostWorkers: 5,
|
||||
}, &testData{})
|
||||
assert.NoError(t, err)
|
||||
|
||||
|
@ -75,9 +79,13 @@ func TestLevelQueue(t *testing.T) {
|
|||
|
||||
// Reopen queue
|
||||
queue, err = NewLevelQueue(handle, LevelQueueConfiguration{
|
||||
DataDir: "level-queue-test-data",
|
||||
BatchLength: 2,
|
||||
Workers: 1,
|
||||
DataDir: "level-queue-test-data",
|
||||
BatchLength: 2,
|
||||
Workers: 1,
|
||||
QueueLength: 20,
|
||||
BlockTimeout: 1 * time.Second,
|
||||
BoostTimeout: 5 * time.Minute,
|
||||
BoostWorkers: 5,
|
||||
}, &testData{})
|
||||
assert.NoError(t, err)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue