This commit is contained in:
2026-01-20 00:10:41 +01:00
parent 40030863c3
commit fd92604589
2 changed files with 5 additions and 3 deletions

View File

@@ -1,9 +1,8 @@
package lib package lib
import ( import (
"encoding/json" // Added for logging "encoding/json"
"os" "os"
// Added for path manipulation
) )
const cacheFileName = "cache.json" // Renamed for clarity const cacheFileName = "cache.json" // Renamed for clarity
@@ -57,9 +56,11 @@ func (c *Cache) IsChanged(fetcher string, value string) bool {
if !found { if !found {
return true return true
} }
if cachedValue != value { if cachedValue != value {
return true return true
} }
return false return false
} }

View File

@@ -68,6 +68,7 @@ func Runner() {
for { for {
log.Println("Run updater...") log.Println("Run updater...")
messages = []string{} // Clear messages for the current iteration
for _, fetcher := range fetchers { for _, fetcher := range fetchers {
fetcher_messages := fetcher.Fetch() fetcher_messages := fetcher.Fetch()
messages = append(messages, fetcher_messages...) messages = append(messages, fetcher_messages...)
@@ -80,6 +81,6 @@ func Runner() {
cache.Save() cache.Save()
time.Sleep(100) time.Sleep(config.Interval)
} }
} }