Skip to content

Instantly share code, notes, and snippets.

@nambrot
Created February 16, 2012 06:47
Show Gist options
  • Save nambrot/1842743 to your computer and use it in GitHub Desktop.
Save nambrot/1842743 to your computer and use it in GitHub Desktop.
app/clock.rb
require 'clockwork'
include Clockwork
require File.expand_path('../../config/boot', __FILE__)
require File.expand_path('../../config/environment', __FILE__)
every(2.hours, 'feeds.refresh') { Delayed::Job.enqueue CollegeJob.new }
class CollegeJob < Object
def perform
College.all.each {|d| College.getPhotos(d)}
end
end
require 'clockwork'
include Clockwork
require File.expand_path('../../config/boot', __FILE__)
require File.expand_path('../../config/environment', __FILE__)
every(2.hours, 'feeds.refresh') { Delayed::Job.enqueue CollegeJob.new }
class CollegeJob < Object
def perform
College.all.each {|d| College.getPhotos(d)}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment