Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gmaps/place.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type PlaceJobOptions func(*PlaceJob)
type PlaceJob struct {
scrapemate.Job

UsageInResultststs bool
UsageInResults bool
ExtractEmail bool
ExitMonitor exiter.Exiter
ExtractExtraReviews bool
Expand All @@ -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

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -291,7 +291,7 @@ func (j *PlaceJob) getReviewCount(data []byte) int {
}

func (j *PlaceJob) UseInResults() bool {
return j.UsageInResultststs
return j.UsageInResults
}

const js = `
Expand Down
2 changes: 1 addition & 1 deletion postgres/resultwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down