From 7e1818d8755255a0f5e7d6744cfca7f855194752 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 6 Jul 2013 18:47:47 +0000 Subject: [PATCH] update report slow --- modules/report/report.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/report/report.js b/modules/report/report.js index ceb327c..52e50c4 100644 --- a/modules/report/report.js +++ b/modules/report/report.js @@ -13,9 +13,15 @@ var report = function(dbot) { } }, this); - _.each(ops, function(user) { - dbot.say(server, user.name, message); - }, this); + var i = 0; + var notifyChannel = function(ops) { + if(i >= ops.length) return; + dbot.say(server, ops[i].name, message); + setTimeout(function() { + i++; notifyChannel(ops); + }, 1000); + }; + notifyChannel(ops); } };