Created
December 10, 2011 22:52
-
-
Save inossidabile/1456866 to your computer and use it in GitHub Desktop.
Sample of Java Quartz inside JRuby on Rails
This file contains hidden or 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
# config/initializers/quartz.rb | |
require 'commons-collections-3.2.1.jar' | |
require 'commons-logging.jar' | |
require 'log4j.jar' | |
require 'quartz-1.6.4.jar' | |
require 'quartz' | |
org.apache.log4j.BasicConfigurator.configure | |
class CronScheduler | |
include Quartz::Scheduler | |
schedule(:grabber, :every=>60.seconds) do | |
info "Grabbing..." | |
Document.grab | |
end | |
end | |
CronScheduler.instance.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment