Added whenever to manage cronjobs.

This commit is contained in:
benni 2012-12-26 14:03:35 +01:00
parent 9ad77f5256
commit d347e2404b
3 changed files with 22 additions and 1 deletions

View File

@ -37,6 +37,7 @@ gem 'acts_as_versioned', git: 'git://github.com/technoweenie/acts_as_versioned.g
gem 'acts_as_tree'
gem 'acts_as_configurable', git: 'git://github.com/bwalding/acts_as_configurable.git'
gem 'resque'
gem 'whenever', :require => false # For defining cronjobs, see config/schedule.rb
group :production do
gem 'exception_notification', :require => 'exception_notifier'

View File

@ -57,6 +57,7 @@ GEM
erubis (>= 2.7.0)
binding_of_caller (0.6.8)
builder (3.0.4)
chronic (0.9.0)
client_side_validations (3.1.4)
coderay (1.0.8)
coffee-rails (3.2.2)
@ -111,7 +112,7 @@ GEM
activesupport (~> 3.1)
polyamorous (~> 0.5.0)
mime-types (1.19)
multi_json (1.3.7)
multi_json (1.5.0)
mysql2 (0.3.11)
pdf-reader (1.2.0)
Ascii85 (~> 1.0.0)
@ -206,6 +207,9 @@ GEM
multi_json (~> 1.0, >= 1.0.2)
vegas (0.1.11)
rack (>= 1.0.0)
whenever (0.8.1)
activesupport (>= 2.3.4)
chronic (>= 0.6.3)
wikicloth (0.8.0)
builder
expression_parser
@ -244,4 +248,5 @@ DEPENDENCIES
therubyracer
twitter-bootstrap-rails
uglifier (>= 1.0.3)
whenever
wikicloth

15
config/schedule.rb Normal file
View File

@ -0,0 +1,15 @@
# Use this file to define all tasks, which should be executed by cron
# Learn more: http://github.com/javan/whenever
# Upcoming tasks notifier
every :day, :at => '7:20 am' do
rake "multicoops:run foodsoft:notify_upcoming_tasks"
end
# Weekly taks
every :sunday, :at => '7:14 am' do
rake "multicoops:run foodsoft:create_upcoming_weekly_tasks"
rake "multicoops:run foodsoft:notify_users_of_weekly_task"
end