Use normal pool, add semaphore lock

This commit is contained in:
Ben Sarmiento
2024-01-11 06:10:43 +01:00
parent 666975211a
commit 3cdc2f8791
2 changed files with 11 additions and 15 deletions

View File

@@ -31,7 +31,6 @@ type TorrentManager struct {
latestState *LibraryState
requiredVersion string
workerPool *ants.Pool
repairWorker *ants.Pool
log *logutil.Logger
}
@@ -95,11 +94,6 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, p
t.SetNewLatestState(t.getCurrentState())
if t.Config.EnableRepair() {
repairWorker, err := ants.NewPool(1)
if err != nil {
log.Fatalf("Failed to create repair worker: %v", err)
}
t.repairWorker = repairWorker
t.RepairAll() // initial repair
} else {
t.log.Info("Repair is disabled, skipping repair check")