schedule
This commit is contained in:
parent
a195d3b8fe
commit
1dd59249c5
1 changed files with 5 additions and 5 deletions
|
|
@ -42,11 +42,11 @@ func main() {
|
||||||
log.Println("Starting scraper with scheduler...")
|
log.Println("Starting scraper with scheduler...")
|
||||||
|
|
||||||
for _, page := range pages {
|
for _, page := range pages {
|
||||||
Work(ctx)(page, googleLinkStream)
|
|
||||||
// sched.Schedule(func(ctx context.Context) {
|
|
||||||
// log.Printf("Running scrape for page offset: %d", page)
|
|
||||||
// Work(ctx)(page, googleLinkStream)
|
// Work(ctx)(page, googleLinkStream)
|
||||||
// }).Every(24 * time.Hour)
|
sched.Schedule(func(ctx context.Context) {
|
||||||
|
log.Printf("Running scrape for page offset: %d", page)
|
||||||
|
Work(ctx)(page, googleLinkStream)
|
||||||
|
}).Every(24 * time.Hour)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := sched.Run(); err != nil {
|
if err := sched.Run(); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue