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:
commit
867586f7f5
@ -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})"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user