Add network test
This commit is contained in:
@@ -52,6 +52,17 @@ func MainApp(configPath string) {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
repo := http.NewIPRepository(log.Named("network_test"))
|
||||
repoClient := http.NewHTTPClient(
|
||||
"",
|
||||
0,
|
||||
1,
|
||||
true,
|
||||
config,
|
||||
log.Named("network_test"),
|
||||
)
|
||||
repo.NetworkTest(repoClient, false)
|
||||
|
||||
apiClient := http.NewHTTPClient(
|
||||
config.GetToken(),
|
||||
config.GetRetriesUntilFailed(), // default retries = 2
|
||||
@@ -74,7 +85,7 @@ func MainApp(configPath string) {
|
||||
"", // no token required for download client
|
||||
config.GetRetriesUntilFailed(), //
|
||||
config.GetDownloadTimeoutSecs(), //
|
||||
true, // download client supports ipv6
|
||||
true, // set as download client
|
||||
config,
|
||||
log.Named("download_client"),
|
||||
)
|
||||
|
||||
@@ -258,9 +258,6 @@ func (t *TorrentManager) applyMediaInfoDetails(torrent *Torrent) {
|
||||
func (t *TorrentManager) readTorrentFromFile(filePath string) *Torrent {
|
||||
file, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
defer file.Close()
|
||||
@@ -318,9 +315,6 @@ func (t *TorrentManager) readInfoFromFile(torrentID string) *realdebrid.TorrentI
|
||||
filePath := "data/info/" + torrentID + ".zurginfo"
|
||||
file, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
Reference in New Issue
Block a user