mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Run the queue faster if multiple requests are pending
This commit is contained in:
parent
5848c16f5d
commit
d05cd52d9a
@ -163,14 +163,16 @@ namespace osu.Game.Online.API
|
||||
continue;
|
||||
}
|
||||
|
||||
APIRequest req = null;
|
||||
|
||||
lock (queue)
|
||||
if (queue.Count > 0)
|
||||
req = queue.Dequeue();
|
||||
|
||||
if (req != null)
|
||||
while (true)
|
||||
{
|
||||
APIRequest req;
|
||||
|
||||
lock (queue)
|
||||
{
|
||||
if (queue.Count == 0) break;
|
||||
req = queue.Dequeue();
|
||||
}
|
||||
|
||||
// TODO: handle failures better
|
||||
handleRequest(req);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user