Class: VehiclesRefreshJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
lib/generators/vehicles/templates/vehicles_refresh_job.rb

Overview

Pulls the latest published VehiclesDB dataset into the local cache, so data fixes and new makes reach this app WITHOUT a gem upgrade. Schedule it (daily is plenty) — e.g. with solid_queue in config/recurring.yml:

vehicles_refresh:
  class: VehiclesRefreshJob
  schedule: every day at 3am

It’s safe to run anytime: it never raises, and a failed/partial download leaves your current data untouched (the gem keeps serving the cache, or the bundled snapshot if there’s no cache yet).

Instance Method Summary collapse

Instance Method Details

#performObject



17
18
19
# File 'lib/generators/vehicles/templates/vehicles_refresh_job.rb', line 17

def perform
  Vehicles.refresh!
end