Class: RailsPulse::BackfillSummariesJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/rails_pulse/backfill_summaries_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(start_date, end_date, period_types = [ "hour", "day" ]) ⇒ nil

Backfills summary data for a date range

Parameters:

  • start_date (String, Date, Time)

    Start of the backfill range

  • end_date (String, Date, Time)

    End of the backfill range

  • period_types (Array<String>) (defaults to: [ "hour", "day" ])

    Period types to backfill (default: [“hour”, “day”])

Returns:

  • (nil)


8
9
10
11
12
13
14
15
# File 'app/jobs/rails_pulse/backfill_summaries_job.rb', line 8

def perform(start_date, end_date, period_types = [ "hour", "day" ])
  start_date = start_date.to_datetime
  end_date = end_date.to_datetime

  period_types.each do |period_type|
    backfill_period(period_type, start_date, end_date)
  end
end