Skip to content

Instantly share code, notes, and snippets.

@chourobin
Forked from teamon/clock.rb
Created February 10, 2013 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chourobin/4748256 to your computer and use it in GitHub Desktop.
Save chourobin/4748256 to your computer and use it in GitHub Desktop.
require 'clockwork'
require 'sidekiq'
# load all jobs from app/jobs directory
# no need to load rails env, we only care about classes
# (#perform method is not invoked in this process)
Dir["app/jobs/*"].each {|f| load f }
module Clockwork
every(1.day, 'midnight.job', :at => '00:00'){
MidnightJob.perform_async(1,2,3)
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment