its the fastest ever

This commit is contained in:
Ben Sarmiento
2024-01-28 02:23:19 +01:00
parent abdc8fcbb0
commit f07b65d5da
7 changed files with 70 additions and 66 deletions

View File

@@ -44,7 +44,7 @@ func MainApp(configPath string) {
os.Exit(1)
}
apiClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), config.GetRealDebridTimeout(), false, config, log.Named("httpclient"))
apiClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), config.GetApiTimeoutSecs(), false, config, log.Named("httpclient"))
rd := realdebrid.NewRealDebrid(apiClient, log.Named("realdebrid"))
@@ -71,8 +71,8 @@ func MainApp(configPath string) {
utils.EnsureDirExists("data") // Ensure the data directory exists
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, config.GetRealDebridTimeout())
downloadClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), config.GetDownloadTimeoutSecs(), true, config, log.Named("dlclient"))
downloader := universal.NewDownloader(downloadClient)
router := chi.NewRouter()
handlers.AttachHandlers(router, downloader, torrentMgr, config, rd, log.Named("router"))