Class: FacebookScrapeRequestWorker

Inherits:
ApplicationWorker show all
Defined in:
app/workers/facebook_scrape_request_worker.rb

Overview

typed: ignore frozen_string_literal: true Ask Facebook to clear restaurant canonical_link cache

Instance Method Summary collapse

Methods inherited from ApplicationWorker

unlimited_retry

Instance Method Details

#perform(restaurant_id = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'app/workers/facebook_scrape_request_worker.rb', line 8

def perform(restaurant_id = nil)
  if restaurant_id
    scrape(Restaurant.find(restaurant_id))
  else
    Restaurant.active.not_expired.find_each do |restaurant|
      scrape(restaurant)
    end
  end
end