Compare commits
No commits in common. "addaade2690d5199c2ef5de795c7fb92a5f06ecc" and "a0133e0981f7b55158d60e60b7d33534940a5187" have entirely different histories.
addaade269
...
a0133e0981
@ -1,9 +1,7 @@
|
||||
package diyhrt
|
||||
|
||||
type DiyHrtConfig struct {
|
||||
ApiKey string
|
||||
FetchIntervals int
|
||||
|
||||
ApiKey string
|
||||
StoreFilter StoreFilter
|
||||
ListingFilter ListingFilter
|
||||
}
|
||||
|
@ -63,8 +63,7 @@ func NewConfig() Config {
|
||||
Port: 5500,
|
||||
},
|
||||
DiyHrt: diyhrt.DiyHrtConfig{
|
||||
ApiKey: os.Getenv("API_KEY"),
|
||||
FetchIntervals: 60, // fetch every hour
|
||||
ApiKey: os.Getenv("API_KEY"),
|
||||
StoreFilter: diyhrt.StoreFilter{
|
||||
Limit: 0,
|
||||
IncludeIds: []int{7},
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"gitea.elara.ws/Hazel/transfem-startpage/internal/cache"
|
||||
"gitea.elara.ws/Hazel/transfem-startpage/internal/rendering"
|
||||
@ -13,26 +12,12 @@ import (
|
||||
|
||||
var Config = rendering.NewConfig()
|
||||
|
||||
func StartFetching() {
|
||||
for {
|
||||
log.Println("Fetch DiyHrt data...")
|
||||
Config.FetchDiyHrt()
|
||||
time.Sleep(time.Duration(Config.DiyHrt.FetchIntervals) * time.Second)
|
||||
|
||||
if Config.DiyHrt.FetchIntervals == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func Start(profile string) error {
|
||||
err := Config.ScanForConfigFile(profile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
go StartFetching()
|
||||
|
||||
err = Config.FetchDiyHrt()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
@ -1 +1 @@
|
||||
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1
|
||||
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1
|
Loading…
x
Reference in New Issue
Block a user