From 525d2bdc03958bc0701038649ed6735f90595161 Mon Sep 17 00:00:00 2001 From: Michael K Date: Fri, 28 Nov 2014 16:44:20 +0100 Subject: [PATCH] Made use of SecondsTillUpdate() Increases code comprehensibility --- feed.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/feed.go b/feed.go index 6a15364..b2ba231 100644 --- a/feed.go +++ b/feed.go @@ -226,11 +226,12 @@ func (this *Feed) notifyListeners() { func (this *Feed) CanUpdate() bool { // Make sure we are not within the specified cache-limit. // This ensures we don't request data too often. - utc := time.Now().UTC() - if utc.UnixNano()-this.lastupdate < int64(this.CacheTimeout*60) { + if SecondsTillUpdate() > 0 { return false } + utc := time.Now().UTC() + // If skipDays or skipHours are set in the RSS feed, use these to see if // we can update. if len(this.Channels) == 1 && this.Type == "rss" {