Add context deadline to request
This commit is contained in:
@@ -58,12 +58,15 @@ func MainApp(configPath string) {
|
||||
}
|
||||
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)
|
||||
var repairPool *ants.Pool
|
||||
if config.EnableRepair() {
|
||||
repairPool, err := ants.NewPool(1)
|
||||
if err != nil {
|
||||
zurglog.Errorf("Failed to create repair pool: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer repairPool.Release()
|
||||
}
|
||||
defer repairPool.Release()
|
||||
|
||||
utils.EnsureDirExists("data") // Ensure the data directory exists
|
||||
torrentMgr := torrent.NewTorrentManager(config, rd, workerPool, repairPool, log.Named("manager"))
|
||||
|
||||
Reference in New Issue
Block a user