Open patrick-hermann-sva opened 1 year ago
trigger sweatshop-fetcher every x seconds sould be possible to implement w/ gocron
example dummy code
package main
// 1
import (
"fmt"
"time"
"github.com/go-co-op/gocron"
)
// 2
func hello(name string) {
message := fmt.Sprintf("Hi, %v", name)
fmt.Println(message)
}
func runCronJobs() {
// 3
s := gocron.NewScheduler(time.UTC)
// 4
s.Every(300).Seconds().Do(func() {
hello("whatever")
})
// 5
s.StartBlocking()
}
// 6
func main() {
runCronJobs()
}