mirror of
https://git.sr.ht/~joren/streamrip-go
synced 2026-06-17 15:05:39 +02:00
performance: tune shared HTTP transport for concurrent CDN downloads
This commit is contained in:
@@ -114,13 +114,20 @@ func New(cfg *config.Config) (*Main, error) {
|
||||
Config: cfg,
|
||||
Providers: providers,
|
||||
Store: db,
|
||||
DL: download.NewWithOptions(cfg.Session.Downloads.VerifySSL, cfg.Session.CLI.ProgressBars),
|
||||
DL: download.NewWithOptions(cfg.Session.Downloads.VerifySSL, cfg.Session.CLI.ProgressBars, downloaderMaxConnsPerHost(cfg.Session.Downloads.MaxConnections)),
|
||||
Tagger: tag.New(),
|
||||
Pending: []media.Pending{},
|
||||
Media: []media.Media{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func downloaderMaxConnsPerHost(maxConnections int) int {
|
||||
if maxConnections > 16 {
|
||||
return maxConnections
|
||||
}
|
||||
return 16
|
||||
}
|
||||
|
||||
func (m *Main) Close() error {
|
||||
m.DL.Close()
|
||||
artwork.CleanupTempDirs()
|
||||
|
||||
Reference in New Issue
Block a user