mirror of
https://github.com/ppy/osu
synced 2025-02-13 16:47:38 +00:00
Ensure token retrieval failure logic only runs once
This commit is contained in:
parent
c4dd23ed15
commit
65369e96eb
@ -92,6 +92,11 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
void handleTokenFailure(Exception exception)
|
void handleTokenFailure(Exception exception)
|
||||||
{
|
{
|
||||||
|
// This method may be invoked multiple times due to the Task.Wait call above.
|
||||||
|
// We only really care about the first error.
|
||||||
|
if (!tcs.TrySetResult(false))
|
||||||
|
return;
|
||||||
|
|
||||||
if (HandleTokenRetrievalFailure(exception))
|
if (HandleTokenRetrievalFailure(exception))
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(exception.Message))
|
if (string.IsNullOrEmpty(exception.Message))
|
||||||
@ -111,8 +116,6 @@ namespace osu.Game.Screens.Play
|
|||||||
// In the future, this should be visible to the user in some way.
|
// In the future, this should be visible to the user in some way.
|
||||||
Logger.Log($"Score submission token retrieval failed ({exception.Message})");
|
Logger.Log($"Score submission token retrieval failed ({exception.Message})");
|
||||||
}
|
}
|
||||||
|
|
||||||
tcs.SetResult(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user