summaryrefslogtreecommitdiffstats
path: root/news
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-03-17 04:23:24 +0100
committerlassulus <lassulus@googlemail.com>2014-03-17 04:23:24 +0100
commit5fbf714096ef65c98cabb54cbc08641f37ffa462 (patch)
tree8706528629da9cc8b3b2eefbe3a4b9e788fe46d1 /news
parentd8623e1d59c20b0640550f885e9cd30e7624f6e7 (diff)
newsboss.js: fancy create delay
Diffstat (limited to 'news')
-rw-r--r--news/newsbot.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/news/newsbot.js b/news/newsbot.js
index a422d867..80bb95b1 100644
--- a/news/newsbot.js
+++ b/news/newsbot.js
@@ -12,6 +12,7 @@ var master_nick = 'knews'
var news_channel = '#news'
var feeds_file = 'new_feeds'
var feedbot_loop_delay = 60 * 1000 // [ms]
+var feedbot_create_delay = 200 // [ms]
var url_shortener_host = 'go'
var slaves = {}
@@ -51,7 +52,7 @@ function main () {
.filter(function (line) {
return line.length > 0
})
- .forEach(function (line) {
+ .forEach(function (line, i) {
var parts = line.split('|')
if (parts.length !== 3) {
console.log('bad new_feeds line ' + lines + ': ' + line)
@@ -62,7 +63,9 @@ function main () {
var uri = parts[1]
var channels = parts[2].split(' ')
- return create_feedbot(nick, uri, channels)
+ setTimeout(function () {
+ return create_feedbot(nick, uri, channels)
+ }, i*feedbot_create_delay)
})
})
}