From 0b07b44aead431257c84ab8a43c29c387668f94a Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Sun, 24 Jan 2016 13:26:52 +0100 Subject: [PATCH] Make rss module more verbose. --- modules/rss/rss.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/rss/rss.go b/modules/rss/rss.go index 0de2040..fde7cbc 100644 --- a/modules/rss/rss.go +++ b/modules/rss/rss.go @@ -31,7 +31,6 @@ func Init(ch chan string, path string) { } defer file.Close() scanner := bufio.NewScanner(file) - <-time.After(60 * time.Second) for scanner.Scan() { go PollFeed(scanner.Text(), 5, charsetReader) } @@ -48,7 +47,7 @@ func PollFeed(uri string, timeout int, cr xmlx.CharsetFunc) { log.Printf("Polling feed: %s", uri) if err := feed.Fetch(uri, cr); err != nil { log.Printf("[e] %s: %s", "*", uri, err) - //sayCh <- fmt.Sprintf("%s\n[e] %s: %s", "*", uri, err) + sayCh <- fmt.Sprintf("%s\n*** [RSS] Error %s: %s", "*", uri, err) return } <-time.After(time.Duration(feed.SecondsTillUpdate() * 1e9)) @@ -56,7 +55,7 @@ func PollFeed(uri string, timeout int, cr xmlx.CharsetFunc) { } func chanHandler(feed *gorss.Feed, newchannels []*gorss.Channel) { - //sayCh <- fmt.Sprintf("%s\n%d new channel(s) in %s", "*", len(newchannels), feed.Url) + sayCh <- fmt.Sprintf("%s\n*** [RSS] %d new channel(s) in %s", "*", len(newchannels), feed.Url) } func itemHandler(feed *gorss.Feed, ch *gorss.Channel, newitems []*gorss.Item) {