1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Merge pull request #16758 from smoogipoo/fix-incomplete-requests-offline

Fix API requests not completing when offline
This commit is contained in:
Dean Herbert 2022-02-03 14:34:24 +09:00 committed by GitHub
commit 867586f7f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -399,7 +399,10 @@ namespace osu.Game.Online.API
lock (queue) lock (queue)
{ {
if (state.Value == APIState.Offline) if (state.Value == APIState.Offline)
{
request.Fail(new WebException(@"User not logged in"));
return; return;
}
queue.Enqueue(request); queue.Enqueue(request);
} }
@ -416,7 +419,7 @@ namespace osu.Game.Online.API
if (failOldRequests) if (failOldRequests)
{ {
foreach (var req in oldQueueRequests) foreach (var req in oldQueueRequests)
req.Fail(new WebException(@"Disconnected from server")); req.Fail(new WebException($@"Request failed from flush operation (state {state.Value})"));
} }
} }
} }