mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:12:56 +08:00
Reduce polling rate when idle even if HighPollRate
is requested
This commit is contained in:
parent
46d2f305b5
commit
4012ef7e7b
@ -90,14 +90,16 @@ namespace osu.Game.Online.Chat
|
|||||||
{
|
{
|
||||||
// Polling will eventually be replaced with websocket, but let's avoid doing these background operations as much as possible for now.
|
// Polling will eventually be replaced with websocket, but let's avoid doing these background operations as much as possible for now.
|
||||||
// The only loss will be delayed PM/message highlight notifications.
|
// The only loss will be delayed PM/message highlight notifications.
|
||||||
if (HighPollRate.Value)
|
int millisecondsBetweenPolls = HighPollRate.Value ? 1000 : 60000;
|
||||||
TimeBetweenPolls.Value = 1000;
|
|
||||||
else if (!isIdle.Value)
|
|
||||||
TimeBetweenPolls.Value = 60000;
|
|
||||||
else
|
|
||||||
TimeBetweenPolls.Value = 600000;
|
|
||||||
|
|
||||||
Logger.Log($"Chat is now polling every {TimeBetweenPolls.Value} ms");
|
if (isIdle.Value)
|
||||||
|
millisecondsBetweenPolls *= 10;
|
||||||
|
|
||||||
|
if (TimeBetweenPolls.Value != millisecondsBetweenPolls)
|
||||||
|
{
|
||||||
|
TimeBetweenPolls.Value = millisecondsBetweenPolls;
|
||||||
|
Logger.Log($"Chat is now polling every {TimeBetweenPolls.Value} ms");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user