repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
3a25a5f
parent
c9c0f38
author
Eric Bower
date
2022-12-22 20:33:53 +0000 UTC
fix(feeds): actually use returned date
1 files changed,  +8, -7
M feeds/cron.go
+8, -7
 1@@ -60,19 +60,20 @@ func NewFetcher(dbpool db.DB, cfg *shared.ConfigSite) *Fetcher {
 2 func digestOptionToTime(date time.Time, interval string) time.Time {
 3 	day := 24 * time.Hour
 4 	if interval == "10min" {
 5-		date.Add(10 * time.Minute)
 6+		return date.Add(10 * time.Minute)
 7 	} else if interval == "1hour" {
 8-		date.Add(1 * time.Hour)
 9+		return date.Add(1 * time.Hour)
10 	} else if interval == "12hour" {
11-		date.Add(12 * time.Hour)
12+		return date.Add(12 * time.Hour)
13 	} else if interval == "1day" || interval == "" {
14-		date.Add(day)
15+		return date.Add(day)
16 	} else if interval == "7day" {
17-		date.Add(7 * day)
18+		return date.Add(7 * day)
19 	} else if interval == "30day" {
20-		date.Add(30 * day)
21+		return date.Add(30 * day)
22+	} else {
23+		return date
24 	}
25-	return date
26 }
27 
28 func (f *Fetcher) Validate(lastDigest *time.Time, parsed *shared.ListParsedText) error {