1
0
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:
Dean Herbert 2022-01-13 17:33:55 +09:00
parent 46d2f305b5
commit 4012ef7e7b

View File

@ -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.
// The only loss will be delayed PM/message highlight notifications.
if (HighPollRate.Value)
TimeBetweenPolls.Value = 1000;
else if (!isIdle.Value)
TimeBetweenPolls.Value = 60000;
else
TimeBetweenPolls.Value = 600000;
int millisecondsBetweenPolls = HighPollRate.Value ? 1000 : 60000;
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>