Added a new function; time till next update as time.Duration
This commit is contained in:
parent
ee66dbdb55
commit
13b293d8cd
5
feed.go
5
feed.go
|
@ -264,6 +264,11 @@ func (this *Feed) SecondsTillUpdate() int64 {
|
||||||
return int64(this.CacheTimeout*60) - int64(elapsed.Seconds())
|
return int64(this.CacheTimeout*60) - int64(elapsed.Seconds())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the duration needed to elapse before the feed should update.
|
||||||
|
func (this *Feed) TillUpdate() (time.Duration, error) {
|
||||||
|
return time.ParseDuration(fmt.Sprintf("%ds", SecondsTillUpdate()))
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Feed) buildFeed(doc *xmlx.Document) (err error) {
|
func (this *Feed) buildFeed(doc *xmlx.Document) (err error) {
|
||||||
switch this.Type {
|
switch this.Type {
|
||||||
case "rss":
|
case "rss":
|
||||||
|
|
Loading…
Reference in New Issue