-
-
Save chourobin/4748256 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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