diff --git a/gmaps/place.go b/gmaps/place.go index fd1a8690..b7eca862 100644 --- a/gmaps/place.go +++ b/gmaps/place.go @@ -17,7 +17,7 @@ type PlaceJobOptions func(*PlaceJob) type PlaceJob struct { scrapemate.Job - UsageInResultststs bool + UsageInResults bool ExtractEmail bool ExitMonitor exiter.Exiter ExtractExtraReviews bool @@ -42,7 +42,7 @@ func NewPlaceJob(parentID, langCode, u string, extractEmail, extraExtraReviews b }, } - job.UsageInResultststs = true + job.UsageInResults = true job.ExtractEmail = extractEmail job.ExtractExtraReviews = extraExtraReviews @@ -133,7 +133,7 @@ func (j *PlaceJob) Process(_ context.Context, resp *scrapemate.Response) (any, [ emailJob := NewEmailJob(j.ID, &entry, opts...) - j.UsageInResultststs = false + j.UsageInResults = false return nil, []scrapemate.IJob{emailJob}, nil } else if j.ExitMonitor != nil && !j.WriterManagedCompletion { @@ -291,7 +291,7 @@ func (j *PlaceJob) getReviewCount(data []byte) int { } func (j *PlaceJob) UseInResults() bool { - return j.UsageInResultststs + return j.UsageInResults } const js = ` diff --git a/postgres/resultwriter.go b/postgres/resultwriter.go index 8658ac27..18d1bff1 100644 --- a/postgres/resultwriter.go +++ b/postgres/resultwriter.go @@ -40,7 +40,7 @@ func (r *resultWriter) Run(ctx context.Context, in <-chan scrapemate.Result) err buff = append(buff, entry) - if len(buff) >= maxBatchSize || time.Now().UTC().Sub(lastSave) >= time.Minute { + if len(buff) >= maxBatchSize || time.Since(lastSave) >= time.Minute { err := r.batchSave(ctx, buff) if err != nil { return err