Made use of SecondsTillUpdate()
Increases code comprehensibility
This commit is contained in:
parent
21cabd67c6
commit
525d2bdc03
5
feed.go
5
feed.go
|
@ -226,11 +226,12 @@ func (this *Feed) notifyListeners() {
|
||||||
func (this *Feed) CanUpdate() bool {
|
func (this *Feed) CanUpdate() bool {
|
||||||
// Make sure we are not within the specified cache-limit.
|
// Make sure we are not within the specified cache-limit.
|
||||||
// This ensures we don't request data too often.
|
// This ensures we don't request data too often.
|
||||||
utc := time.Now().UTC()
|
if SecondsTillUpdate() > 0 {
|
||||||
if utc.UnixNano()-this.lastupdate < int64(this.CacheTimeout*60) {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
utc := time.Now().UTC()
|
||||||
|
|
||||||
// If skipDays or skipHours are set in the RSS feed, use these to see if
|
// If skipDays or skipHours are set in the RSS feed, use these to see if
|
||||||
// we can update.
|
// we can update.
|
||||||
if len(this.Channels) == 1 && this.Type == "rss" {
|
if len(this.Channels) == 1 && this.Type == "rss" {
|
||||||
|
|
Loading…
Reference in New Issue