Class: SweeperJob

Inherits:
Resque::Plugins::Loner::UniqueJob
  • Object
show all
Defined in:
lib/sweeper_job.rb

Class Method Summary collapse

Class Method Details

.perform(urls, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/sweeper_job.rb', line 6

def self.perform( urls, options = {} )
  if urls
    urls.each do |url|
      Curl::Easy.perform(url) do |curl| 
        curl.headers["X-Varnish-Control"] = "sweep"
      end
      Rails.logger.debug "sweeped #{url}"
    end
  end
end