Query in question being
|
public static int? GetScoreRankOnBeatmapLeaderboard(SoloScore score) |
|
{ |
|
try |
|
{ |
|
string? token = retrieveAccessToken(); |
|
if (token == null) |
|
return null; |
|
|
|
var requestMsg = new HttpRequestMessage(HttpMethod.Get, $"{shared_interop_domain}/api/v2/scores/{score.id}"); |
|
requestMsg.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token); |
|
requestMsg.Headers.Add("x-api-version", "20250804"); |
|
var responseMsg = http.Send(requestMsg); |
|
|
|
if (!responseMsg.IsSuccessStatusCode || responseMsg.Content.ReadFromJsonAsync<ScoreResponse>().Result is not ScoreResponse scoreResponse) |
|
{ |
|
SentrySdk.CaptureMessage($"Failed to retrieve score rank from API: received status code {responseMsg.StatusCode}, content: {responseMsg.Content.ReadAsStringAsync().Result}", |
|
SentryLevel.Warning); |
|
return null; |
|
} |
|
|
|
return scoreResponse.rank_global; |
|
} |
|
catch (Exception e) |
|
{ |
|
SentrySdk.CaptureException(e, scope => scope.Level = SentryLevel.Warning); |
|
return null; |
|
} |
|
} |
and the solution for its replacement probably being
|
/// If this ever becomes a problem the proposition is to move the ES lookup logic to https://github.com/ppy/osu-global-rank-lookup-cache and have both web and this call into that component. |
Also possibly worth adjusting this such that the rank query isn't under the transaction. See also: #341.
Query in question being
osu-queue-score-statistics/osu.Server.Queues.ScoreStatisticsProcessor/Helpers/WebRequestHelper.cs
Lines 149 to 176 in 4bdd479
and the solution for its replacement probably being
osu-queue-score-statistics/osu.Server.Queues.ScoreStatisticsProcessor/Helpers/WebRequestHelper.cs
Line 142 in 4bdd479
Also possibly worth adjusting this such that the rank query isn't under the transaction. See also: #341.