Make retry process shorter when trying to retrieve latest version on nuget and log for only debug

resolves https://github.com/abpframework/abp/issues/3155
pull/3158/head
Yunus Emre Kalkan 6 years ago
parent f9050f93b9
commit f9ee5bf2d9

@ -95,21 +95,19 @@ namespace Volo.Abp.Cli.NuGet
.OrResult(msg => !msg.IsSuccessStatusCode)
.WaitAndRetryAsync(new[]
{
TimeSpan.FromSeconds(1),
TimeSpan.FromSeconds(3),
TimeSpan.FromSeconds(7)
TimeSpan.FromSeconds(1)
},
(responseMessage, timeSpan, retryCount, context) =>
{
if (responseMessage.Exception != null)
{
Logger.LogWarning(
Logger.LogDebug(
$"{retryCount}. HTTP request attempt failed to {url} with an error: HTTP {(int)responseMessage.Result.StatusCode}-{responseMessage.Exception.Message}. " +
$"Waiting {timeSpan.TotalSeconds} secs for the next try...");
}
else if (responseMessage.Result != null)
{
Logger.LogWarning(
Logger.LogDebug(
$"{retryCount}. HTTP request attempt failed to {url} with an error: {(int)responseMessage.Result.StatusCode}-{responseMessage.Result.ReasonPhrase}. " +
$"Waiting {timeSpan.TotalSeconds} secs for the next try...");
}

@ -106,7 +106,7 @@ namespace Volo.Abp.Cli.ProjectModification
}
else
{
Logger.LogDebug("Package: \"{0}-v{1}\" is up to date.", packageId, packageVersion);
Logger.LogInformation("Package: \"{0}-v{1}\" is up to date.", packageId, packageVersion);
}
}
}

Loading…
Cancel
Save