Skip to content

Commit

Permalink
Start processing "yesterday" data around 10:30 UTC (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-soltesz authored Jul 15, 2020
1 parent 37688c3 commit 5bbfbe4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion job-service/job-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func NewJobService(ctx context.Context, tk jobAdder, startDate time.Time,
log.Fatal("No jobs specified")
}

yesterday, err := initYesterday(ctx, saver, 6*time.Hour, specs)
yesterday, err := initYesterday(ctx, saver, 10*time.Hour+30*time.Minute, specs)
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion job-service/job-service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ func TestYesterdayFromSaver(t *testing.T) {

// This allows predictable behavior from time.Since in the advanceDate function.
monkey.Patch(time.Now, func() time.Time {
return time.Date(2011, 2, 16, 6, 2, 3, 4, time.UTC)
// NOTE: must be later than the default "yesterday" delay.
return time.Date(2011, 2, 16, 11, 2, 3, 4, time.UTC)
})

start := time.Date(2011, 2, 3, 0, 0, 0, 0, time.UTC)
Expand Down
4 changes: 2 additions & 2 deletions reproc/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ queueLoop:
return maxDate, nil
}

// dailyDelay is set to 8:30 to allow time for the maximum
// dailyDelay is set to 10:30 to allow time for the maximum
// possible pusher delay for the previous day, plus several GCS transfer jobs to
// complete.
var dailyDelay = 8*time.Hour + 30*time.Minute
var dailyDelay = 10*time.Hour + 30*time.Minute

// findNextRecentDay finds an appropriate date to start daily processing.
func findNextRecentDay(start time.Time, skip int) time.Time {
Expand Down

0 comments on commit 5bbfbe4

Please sign in to comment.