Use normal pool, add semaphore lock
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user