Skip to content

Instantly share code, notes, and snippets.

@teamon
Created October 20, 2012 21:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save teamon/3924858 to your computer and use it in GitHub Desktop.
Save teamon/3924858 to your computer and use it in GitHub Desktop.
clockwork + sidekiq integration
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
@sergiopvilar
Copy link

Not a good choice skip rails if you are using different configuration for Redis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment