Skip to content

Commit

Permalink
fix: don't log every time tracker is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
pwall2222 committed Nov 20, 2023
1 parent e6eb205 commit 786f0b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NOWT/Helpers/LiveMatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ private static async Task<Uri> TrackerAsync(string username)
{
var encodedUsername = Uri.EscapeDataString(username);
var url = new Uri("https://tracker.gg/valorant/profile/riot/" + encodedUsername);
var response = await DoCachedRequestAsync(Method.Get, url.ToString(), false).ConfigureAwait(false);
var response = await DoCachedRequestAsync(Method.Get, url.ToString(), false, false, false).ConfigureAwait(false);
var numericStatusCode = (short)response.StatusCode;
if (numericStatusCode == 200) return url;
}
Expand Down
4 changes: 2 additions & 2 deletions NOWT/Helpers/Login.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private static async Task GetLatestVersionAsync()
}

public static async Task<RestResponse> DoCachedRequestAsync(Method method, string url, bool addRiotAuth,
bool bypassCache = false)
bool bypassCache = false, bool displayError = true)
{
var attemptCache = method == Method.Get && !bypassCache;
if (attemptCache)
Expand All @@ -162,7 +162,7 @@ public static async Task<RestResponse> DoCachedRequestAsync(Method method, strin
}

var response = await client.ExecuteAsync(request, method).ConfigureAwait(false);
if (!response.IsSuccessful)
if (!response.IsSuccessful && displayError)
{
Constants.Log.Error("Request to {url} Failed: {e}", url, response.ErrorException);
return response;
Expand Down

0 comments on commit 786f0b0

Please sign in to comment.