From d8182a663a9979bde9f42d2c8d837b6f6133b515 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Mon, 5 Sep 2016 21:19:08 +0200 Subject: [PATCH] Streams have 60 second delay after starting up, refresh every 60 seconds --- .../Modules/Searches/Commands/StreamNotifications.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/NadekoBot/Modules/Searches/Commands/StreamNotifications.cs b/NadekoBot/Modules/Searches/Commands/StreamNotifications.cs index 153c48db..1513d0e7 100644 --- a/NadekoBot/Modules/Searches/Commands/StreamNotifications.cs +++ b/NadekoBot/Modules/Searches/Commands/StreamNotifications.cs @@ -18,8 +18,11 @@ namespace NadekoBot.Modules.Searches.Commands public StreamNotifications(DiscordModule module) : base(module) { //start checking only after ready, because we need all servers to be initialized - NadekoBot.OnReady += () => Task.Run(async () => + NadekoBot.OnReady += () => { + Task.Run(async () => + { + await Task.Delay(60000); while (true) { cachedStatuses.Clear(); @@ -80,12 +83,13 @@ namespace NadekoBot.Modules.Searches.Commands catch { } finally { - await Task.Delay(TimeSpan.FromSeconds(15)); + await Task.Delay(TimeSpan.FromSeconds(60)); } } }); - } + }; + } private async Task> GetStreamStatus(StreamNotificationConfig stream, bool checkCache = true) { bool isLive;