mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:02:57 +08: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)
|
||||
{
|
||||
// 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 (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.
|
||||
Logger.Log($"Score submission token retrieval failed ({exception.Message})");
|
||||
}
|
||||
|
||||
tcs.SetResult(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user