From 8e20a7cb0ea98e119cbdea328b90dbe8218b32a8 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 31 Jan 2019 17:19:12 +0800 Subject: [PATCH] add limit queue running --- module/twitch-irc/twitch-irc.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/module/twitch-irc/twitch-irc.go b/module/twitch-irc/twitch-irc.go index 15af3a3..e63c384 100644 --- a/module/twitch-irc/twitch-irc.go +++ b/module/twitch-irc/twitch-irc.go @@ -14,6 +14,11 @@ import ( var client *irc.Client var queue *QueueList var channels []string +var queueRunning bool + +func init() { + queueRunning = false +} // InitIRC - func InitIRC() { @@ -140,6 +145,10 @@ func LeaveAllChannel() { } func runQueue() { + if queueRunning == true { + return + } + queueRunning = true go func() { cnt := 0 for {