MCPcopy
hub / github.com/cloudreve/cloudreve / IoIntenseQueue

Method IoIntenseQueue

application/dependency/dependency.go:659–687  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

657}
658
659func (d *dependency) IoIntenseQueue(ctx context.Context) queue.Queue {
660 d.mu.Lock()
661 defer d.mu.Unlock()
662
663 _, reload := ctx.Value(ReloadCtx{}).(bool)
664 if d.ioIntenseQueue != nil && !reload {
665 return d.ioIntenseQueue
666 }
667
668 if d.ioIntenseQueue != nil {
669 d.ioIntenseQueue.Shutdown()
670 }
671
672 settings := d.SettingProvider()
673 queueSetting := settings.Queue(context.Background(), setting.QueueTypeIOIntense)
674
675 d.ioIntenseQueue = queue.New(d.Logger(), d.TaskClient(), d.TaskRegistry(), d,
676 queue.WithBackoffFactor(queueSetting.BackoffFactor),
677 queue.WithMaxRetry(queueSetting.MaxRetry),
678 queue.WithBackoffMaxDuration(queueSetting.BackoffMaxDuration),
679 queue.WithRetryDelay(queueSetting.RetryDelay),
680 queue.WithWorkerCount(queueSetting.WorkerNum),
681 queue.WithName("IoIntenseQueue"),
682 queue.WithMaxTaskExecution(queueSetting.MaxExecution),
683 queue.WithResumeTaskType(queue.CreateArchiveTaskType, queue.ExtractArchiveTaskType, queue.RelocateTaskType, queue.ImportTaskType),
684 queue.WithTaskPullInterval(10*time.Second),
685 )
686 return d.ioIntenseQueue
687}
688
689func (d *dependency) RemoteDownloadQueue(ctx context.Context) queue.Queue {
690 d.mu.Lock()

Callers

nothing calls this directly

Calls 15

SettingProviderMethod · 0.95
LoggerMethod · 0.95
TaskClientMethod · 0.95
TaskRegistryMethod · 0.95
NewFunction · 0.92
WithBackoffFactorFunction · 0.92
WithMaxRetryFunction · 0.92
WithBackoffMaxDurationFunction · 0.92
WithRetryDelayFunction · 0.92
WithWorkerCountFunction · 0.92
WithNameFunction · 0.92
WithMaxTaskExecutionFunction · 0.92

Tested by

no test coverage detected