Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 50 lines (38 sloc) 1.053 kB
#!/usr/bin/ruby
require 'rubygems' unless defined?(Gem)
require 'bundler/setup'
require 'forever'
Forever.run :fork => ENV['FORK'] do
dir File.expand_path('../', __FILE__) # Default is ../../__FILE__
every 5.seconds do
puts 'every 5 seconds'
end
on_ready do
puts "All jobs will will wait me for 1 second"; sleep 1
end
every 30.seconds do
puts "Every 30 seconds from start with boom"
raise "woooooa"
end
every 1.seconds, :at => "#{Time.now.hour}:#{Time.now.min+1}" do
puts "Every one second but first call at #{Time.now.hour}:#{Time.now.min}"
end
every 10.seconds do
puts "Every 10 second"
end
every 20.seconds do
puts "Every 20 second"
end
every 15.seconds do
puts "Every 15 seconds, but my task requires 10 seconds"; sleep 10
end
every 10.seconds, :at => [":#{Time.now.min+1}", ":#{Time.now.min+2}"] do
puts "Every 10 seconds but first call at xx:#{Time.now.min}"
end
on_error do |e|
puts "Boom raised: #{e.message}"
end
on_exit do
puts "Bye bye"
end
end
Jump to Line
Something went wrong with that request. Please try again.