Sha256: 34f6958566a2dd24403ed8163674920b7cd52f48a24e41f9d4dd6253b9adb4df
Contents?: true
Size: 1.51 KB
Versions: 15
Compression:
Stored size: 1.51 KB
Contents
# Generated cron daemon # Do your post daemonization configuration here # At minimum you need just the first line (without the block), or a lot # of strange things might start happening... DaemonKit::Application.running! do |config| # Trap signals with blocks or procs # config.trap( 'INT' ) do # # do something clever # end # config.trap( 'TERM', Proc.new { puts 'Going down' } ) end # Configuration documentation available at http://rufus.rubyforge.org/rufus-scheduler/ # An instance of the scheduler is available through # DaemonKit::Cron.scheduler # To make use of the EventMachine-powered scheduler, uncomment the # line below *before* adding any schedules. # DaemonKit::EM.run # Some samples to get you going: # Will call #regenerate_monthly_report in 3 days from starting up #DaemonKit::Cron.scheduler.in("3d") do # regenerate_monthly_report() #end # #DaemonKit::Cron.scheduler.every "10m10s" do # check_score(favourite_team) # every 10 minutes and 10 seconds #end # #DaemonKit::Cron.scheduler.cron "0 22 * * 1-5" do # DaemonKit.logger.info "activating security system..." # activate_security_system() #end # # Example error handling (NOTE: all exceptions in scheduled tasks are logged) #DaemonKit::Cron.handle_exception do |job, exception| # DaemonKit.logger.error "Caught exception in job #{job.job_id}: '#{exception}'" #end DaemonKit::Cron.scheduler.every("1m") do DaemonKit.logger.debug "Scheduled task completed at #{Time.now}" end # Run our 'cron' dameon, suspending the current thread DaemonKit::Cron.run
Version data entries
15 entries across 15 versions & 2 rubygems