mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-07-08 05:54:30 +08:00
Add Unique Queue infrastructure and move TestPullRequests to this (#9856)
* Upgrade levelqueue to version 0.2.0 This adds functionality for Unique Queues * Add UniqueQueue interface and functions to create them * Add UniqueQueue implementations * Move TestPullRequests over to use UniqueQueue * Reduce code duplication * Add bytefifos * Ensure invalid types are logged * Fix close race in PersistableChannelQueue Shutdown
This commit is contained in:
docs/content/doc/advanced
go.modgo.summodules
queue
bytefifo.goqueue.goqueue_bytefifo.goqueue_channel.goqueue_disk.goqueue_disk_channel.goqueue_disk_test.goqueue_redis.gosetting.gounique_queue.gounique_queue_channel.gounique_queue_disk.gounique_queue_disk_channel.gounique_queue_redis.gounique_queue_wrapped.go
setting
routers
services/pull
vendor
@ -34,16 +34,18 @@ func TestLevelQueue(t *testing.T) {
|
||||
defer os.RemoveAll(tmpDir)
|
||||
|
||||
queue, err := NewLevelQueue(handle, LevelQueueConfiguration{
|
||||
WorkerPoolConfiguration: WorkerPoolConfiguration{
|
||||
QueueLength: 20,
|
||||
BatchLength: 2,
|
||||
BlockTimeout: 1 * time.Second,
|
||||
BoostTimeout: 5 * time.Minute,
|
||||
BoostWorkers: 5,
|
||||
MaxWorkers: 10,
|
||||
ByteFIFOQueueConfiguration: ByteFIFOQueueConfiguration{
|
||||
WorkerPoolConfiguration: WorkerPoolConfiguration{
|
||||
QueueLength: 20,
|
||||
BatchLength: 2,
|
||||
BlockTimeout: 1 * time.Second,
|
||||
BoostTimeout: 5 * time.Minute,
|
||||
BoostWorkers: 5,
|
||||
MaxWorkers: 10,
|
||||
},
|
||||
Workers: 1,
|
||||
},
|
||||
DataDir: tmpDir,
|
||||
Workers: 1,
|
||||
}, &testData{})
|
||||
assert.NoError(t, err)
|
||||
|
||||
@ -105,16 +107,18 @@ func TestLevelQueue(t *testing.T) {
|
||||
WrappedQueueConfiguration{
|
||||
Underlying: LevelQueueType,
|
||||
Config: LevelQueueConfiguration{
|
||||
WorkerPoolConfiguration: WorkerPoolConfiguration{
|
||||
QueueLength: 20,
|
||||
BatchLength: 2,
|
||||
BlockTimeout: 1 * time.Second,
|
||||
BoostTimeout: 5 * time.Minute,
|
||||
BoostWorkers: 5,
|
||||
MaxWorkers: 10,
|
||||
ByteFIFOQueueConfiguration: ByteFIFOQueueConfiguration{
|
||||
WorkerPoolConfiguration: WorkerPoolConfiguration{
|
||||
QueueLength: 20,
|
||||
BatchLength: 2,
|
||||
BlockTimeout: 1 * time.Second,
|
||||
BoostTimeout: 5 * time.Minute,
|
||||
BoostWorkers: 5,
|
||||
MaxWorkers: 10,
|
||||
},
|
||||
Workers: 1,
|
||||
},
|
||||
DataDir: tmpDir,
|
||||
Workers: 1,
|
||||
},
|
||||
}, &testData{})
|
||||
assert.NoError(t, err)
|
||||
|
Reference in New Issue
Block a user