1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 15:43:21 +08:00

Guard against SubmittingPlayer potentially getting stuck waiting on request forever

This commit is contained in:
Dean Herbert 2022-08-20 17:19:17 +09:00
parent a1e849c4db
commit 8566e93c72

View File

@ -8,7 +8,6 @@ using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Logging;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
@ -84,7 +83,10 @@ namespace osu.Game.Screens.Play
api.Queue(req);
tcs.Task.WaitSafely();
// Generally a timeout would not happen here as APIAccess will timeout first.
if (!tcs.Task.Wait(60000))
handleTokenFailure(new InvalidOperationException("Token retrieval timed out (request never run)"));
return true;
void handleTokenFailure(Exception exception)