Fix web requests potentially being performed after cancelled

Closes https://github.com/ppy/osu/issues/18524.
This commit is contained in:
Dean Herbert
2022-06-02 14:28:48 +09:00
parent 1af51a2b19
commit eb2d822530

View File

@ -121,8 +121,16 @@ namespace osu.Game.Online.API
if (isFailing) return; if (isFailing) return;
try
{
Logger.Log($@"Performing request {this}", LoggingTarget.Network); Logger.Log($@"Performing request {this}", LoggingTarget.Network);
WebRequest.Perform(); WebRequest.Perform();
}
catch (OperationCanceledException)
{
// ignore this. internally Perform is running async and the fail state may have changed since
// the last check of `isFailing` above.
}
if (isFailing) return; if (isFailing) return;