public
Last active

my clock.rb config

  • Download Gist
clock.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
require 'clockwork'
require './config/boot'
require './config/environment'
include Clockwork
 
handler do |job|
puts "Running #{job}"
end
 
# [499, "sunday"], [500, "monday"], [498, "tuesday"], [497, "wednesday"], [504, "thursday"], [501, "friday"], [502, "saturday"]
 
every(1.week, 'Create Sunday Campaign', :at => 'Sunday 12:00') do
EmailAlert.perform_async(499)
end
 
every(1.week, 'Create Monday Campaign', :at => 'Monday 12:00') do
EmailAlert.perform_async(500)
end
 
every(1.week, 'Create Tuesday Campaign', :at => 'Tuesday 12:00') do
EmailAlert.perform_async(498)
end
 
every(1.week, 'Create Wednesday Campaign', :at => 'Wednesday 12:00') do
EmailAlert.perform_async(497)
end
 
every(1.week, 'Create Thursday Campaign', :at => 'Thursday 12:00') do
EmailAlert.perform_async(504)
end
 
every(1.week, 'Create Friday Campaign', :at => 'Friday 12:00') do
EmailAlert.perform_async(501)
end
 
every(1.week, 'Create Saturday Campaign', :at => 'Saturday 12:00') do
EmailAlert.perform_async(502)
end
 
every(1.day, 'Get Data from Google Anal') do
Popular.perform_async
end
error
1 2 3 4 5 6 7 8 9 10 11 12 13
$ clockwork clock.rb
/Users/lurraca/.rvm/gems/ruby-1.9.3-p194@shop.pr/gems/activesupport-3.2.11/lib/active_support/duration.rb:107:in `method_missing': undefined method `public_instance_methods' for 604800:Fixnum (NoMethodError)
from /Users/lurraca/.rvm/gems/ruby-1.9.3-p194@shop.pr/gems/sinatra-1.4.3/lib/sinatra/base.rb:1903:in `block in register'
from /Users/lurraca/.rvm/gems/ruby-1.9.3-p194@shop.pr/gems/sinatra-1.4.3/lib/sinatra/base.rb:1903:in `map'
from /Users/lurraca/.rvm/gems/ruby-1.9.3-p194@shop.pr/gems/sinatra-1.4.3/lib/sinatra/base.rb:1903:in `register'
from /Users/lurraca/.rvm/gems/ruby-1.9.3-p194@shop.pr/gems/sinatra-1.4.3/lib/sinatra/base.rb:1917:in `block (2 levels) in delegate'
from /Users/lurraca/.rvm/gems/ruby-1.9.3-p194@shop.pr/gems/clockwork-0.5.2/lib/clockwork.rb:173:in `every'
from /Users/lurraca/Desktop/projects/pixelpt/shop.pr-web.rails/clock.rb:12:in `<top (required)>'
from /Users/lurraca/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/lurraca/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/lurraca/.rvm/gems/ruby-1.9.3-p194@shop.pr/gems/clockwork-0.5.2/bin/clockwork:12:in `<top (required)>'
from /Users/lurraca/.rvm/gems/ruby-1.9.3-p194@shop.pr/bin/clockwork:23:in `load'
from /Users/lurraca/.rvm/gems/ruby-1.9.3-p194@shop.pr/bin/clockwork:23:in `<main>'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.