From cf10822b6ea5c934dcb700fc9c53af9e929961e0 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Wed, 17 Feb 2016 14:09:09 +0100 Subject: [PATCH] Upped the stream check delay Temporary "fix". Will check for multiple streams in a single request in the future. --- cogs/streams.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cogs/streams.py b/cogs/streams.py index fdb143040..1717f5776 100644 --- a/cogs/streams.py +++ b/cogs/streams.py @@ -18,7 +18,6 @@ class Streams: self.bot = bot self.twitch_streams = fileIO("data/streams/twitch.json", "load") self.hitbox_streams = fileIO("data/streams/hitbox.json", "load") - self.pattern = {"CHANNELS" : [], "NAME" : "", "ALREADY_ONLINE" : False} @commands.command() async def hitbox(self, stream : str): @@ -191,7 +190,7 @@ class Streams: return False async def stream_checker(self): - CHECK_DELAY = 10 + CHECK_DELAY = 60 while "Streams" in self.bot.cogs: old = (deepcopy(self.twitch_streams), deepcopy(self.hitbox_streams)) @@ -205,7 +204,7 @@ class Streams: await self.bot.send_message(self.bot.get_channel(channel), "http://www.twitch.tv/{} is online!".format(stream["NAME"])) else: if stream["ALREADY_ONLINE"] and not online: stream["ALREADY_ONLINE"] = False - await asyncio.sleep(1) + await asyncio.sleep(0.5) for stream in self.hitbox_streams: online = await self.hitbox_online(stream["NAME"]) @@ -216,7 +215,7 @@ class Streams: await self.bot.send_message(self.bot.get_channel(channel), "http://www.hitbox.tv/{} is online!".format(stream["NAME"])) else: if stream["ALREADY_ONLINE"] and not online: stream["ALREADY_ONLINE"] = False - await asyncio.sleep(1) + await asyncio.sleep(0.5) if old != (self.twitch_streams, self.hitbox_streams): fileIO("data/streams/twitch.json", "save", self.twitch_streams)