Add bandwidth tracking

This commit is contained in:
Ben Adrian Sarmiento
2024-06-24 23:04:31 +02:00
parent ec25c1ef17
commit e9e31759c1
3 changed files with 131 additions and 19 deletions

View File

@@ -102,7 +102,11 @@ func MainApp(configPath string) {
log.Named("download_client"),
)
workerPool, err := ants.NewPool(config.GetNumberOfWorkers())
workerCount := config.GetNumberOfWorkers()
if workerCount < 10 {
workerCount = 10
}
workerPool, err := ants.NewPool(workerCount)
if err != nil {
zurglog.Errorf("Failed to create worker pool: %v", err)
os.Exit(1)
@@ -140,7 +144,7 @@ func MainApp(configPath string) {
log.Named("repair"),
)
downloader := universal.NewDownloader(downloadClient)
downloader := universal.NewDownloader(downloadClient, workerPool)
router := chi.NewRouter()
handlers.AttachHandlers(