Made use of SecondsTillUpdate()

Increases code comprehensibility
This commit is contained in:
Michael K 2014-11-28 16:44:20 +01:00
parent 21cabd67c6
commit 525d2bdc03
1 changed files with 3 additions and 2 deletions

View File

@ -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" {