From f7fef50d5a87c46d76e2e084614527e410d64c6b Mon Sep 17 00:00:00 2001 From: boypt <1033514+boypt@users.noreply.github.com> Date: Wed, 14 Jul 2021 11:13:13 +0800 Subject: [PATCH] fix: rss update on startup --- server/server_bg.go | 3 ++- server/server_rss.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/server_bg.go b/server/server_bg.go index 19a0666e..f479be10 100644 --- a/server/server_bg.go +++ b/server/server_bg.go @@ -31,10 +31,11 @@ func (s *Server) backgroundRoutines() { // rss updater go func() { // skip if not configured - if !strings.HasPrefix(s.engineConfig.RssURL, "http") { + if strings.TrimSpace(s.engineConfig.RssURL) == "" { return } + s.updateRSS() for range time.Tick(30 * time.Minute) { s.updateRSS() } diff --git a/server/server_rss.go b/server/server_rss.go index 6f1f5036..db3b1ba6 100644 --- a/server/server_rss.go +++ b/server/server_rss.go @@ -78,6 +78,7 @@ func (s *Server) updateRSS() { }) if len(s.state.rssCache) > 0 { s.state.LatestRSSGuid = s.state.rssCache[0].GUID + s.state.Push() } }