Use ants pool instead
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/debridmediamanager.com/zurg/internal/net"
|
||||
"github.com/debridmediamanager.com/zurg/internal/torrent"
|
||||
"github.com/debridmediamanager.com/zurg/internal/version"
|
||||
"github.com/panjf2000/ants/v2"
|
||||
|
||||
// zurghttp "github.com/debridmediamanager.com/zurg/pkg/http"
|
||||
"github.com/debridmediamanager.com/zurg/pkg/logutil"
|
||||
@@ -44,7 +45,13 @@ func main() {
|
||||
|
||||
rd := realdebrid.NewRealDebrid(config.GetToken(), logutil.NewLogger().Named("realdebrid"))
|
||||
|
||||
torrentMgr := torrent.NewTorrentManager(config, rd)
|
||||
p, err := ants.NewPool(config.GetNumOfWorkers())
|
||||
if err != nil {
|
||||
log.Panicf("Failed to create ants pool: %v", err)
|
||||
}
|
||||
defer p.Release()
|
||||
|
||||
torrentMgr := torrent.NewTorrentManager(config, rd, p)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
net.Router(mux, config, torrentMgr, cache)
|
||||
|
||||
Reference in New Issue
Block a user