Add network test

This commit is contained in:
Ben Adrian Sarmiento
2024-06-16 06:06:57 +02:00
parent b1427c2d63
commit e50806d8e1
4 changed files with 235 additions and 33 deletions

View File

@@ -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"),
)