(ctx context.Context)
| 687 | } |
| 688 | |
| 689 | func (d *dependency) RemoteDownloadQueue(ctx context.Context) queue.Queue { |
| 690 | d.mu.Lock() |
| 691 | defer d.mu.Unlock() |
| 692 | |
| 693 | _, reload := ctx.Value(ReloadCtx{}).(bool) |
| 694 | if d.remoteDownloadQueue != nil && !reload { |
| 695 | return d.remoteDownloadQueue |
| 696 | } |
| 697 | |
| 698 | if d.remoteDownloadQueue != nil { |
| 699 | d.remoteDownloadQueue.Shutdown() |
| 700 | } |
| 701 | |
| 702 | settings := d.SettingProvider() |
| 703 | queueSetting := settings.Queue(context.Background(), setting.QueueTypeRemoteDownload) |
| 704 | |
| 705 | d.remoteDownloadQueue = queue.New(d.Logger(), d.TaskClient(), d.TaskRegistry(), d, |
| 706 | queue.WithBackoffFactor(queueSetting.BackoffFactor), |
| 707 | queue.WithMaxRetry(queueSetting.MaxRetry), |
| 708 | queue.WithBackoffMaxDuration(queueSetting.BackoffMaxDuration), |
| 709 | queue.WithRetryDelay(queueSetting.RetryDelay), |
| 710 | queue.WithWorkerCount(queueSetting.WorkerNum), |
| 711 | queue.WithName("RemoteDownloadQueue"), |
| 712 | queue.WithMaxTaskExecution(queueSetting.MaxExecution), |
| 713 | queue.WithResumeTaskType(queue.RemoteDownloadTaskType), |
| 714 | queue.WithTaskPullInterval(10*time.Second), |
| 715 | ) |
| 716 | return d.remoteDownloadQueue |
| 717 | } |
| 718 | |
| 719 | func (d *dependency) EntityRecycleQueue(ctx context.Context) queue.Queue { |
| 720 | d.mu.Lock() |
nothing calls this directly
no test coverage detected