Class: RefreshSitemapJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/refresh_sitemap_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(*_args) ⇒ Object


4
5
6
7
8
9
10
11
12
13
# File 'app/jobs/refresh_sitemap_job.rb', line 4

def perform(*_args)
  EventTracker.notify :sitemap, :started
  SitemapGenerator::Interpreter.run(config_file: nil, verbose: false)
  SitemapGenerator::Sitemap.ping_search_engines
  EventTracker.track_and_notify :sitemap, :refresh
rescue StandardError => ex
  EventTracker.notify :sitemap, :failed, ex.to_s

  raise ex
end