Final repair fixes
This commit is contained in:
@@ -41,15 +41,22 @@ func MainApp(configPath string) {
|
||||
|
||||
premium.MonitorPremiumStatus(rd, zurglog)
|
||||
|
||||
p, err := ants.NewPool(config.GetNumOfWorkers() + 1)
|
||||
workerPool, err := ants.NewPool(config.GetNumOfWorkers() + 1)
|
||||
if err != nil {
|
||||
zurglog.Errorf("Failed to create worker pool: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer p.Release()
|
||||
defer workerPool.Release()
|
||||
|
||||
repairPool, err := ants.NewPool(1, ants.WithMaxBlockingTasks(1))
|
||||
if err != nil {
|
||||
zurglog.Errorf("Failed to create repair pool: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer repairPool.Release()
|
||||
|
||||
utils.EnsureDirExists("data") // Ensure the data directory exists
|
||||
torrentMgr := torrent.NewTorrentManager(config, rd, p, log.Named("manager"))
|
||||
torrentMgr := torrent.NewTorrentManager(config, rd, workerPool, repairPool, log.Named("manager"))
|
||||
|
||||
downloadClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), 0, true, config, log.Named("dlclient"))
|
||||
downloader := universal.NewDownloader(downloadClient)
|
||||
|
||||
Reference in New Issue
Block a user