Added whenever to manage cronjobs.
This commit is contained in:
parent
9ad77f5256
commit
d347e2404b
3 changed files with 22 additions and 1 deletions
1
Gemfile
1
Gemfile
|
@ -37,6 +37,7 @@ gem 'acts_as_versioned', git: 'git://github.com/technoweenie/acts_as_versioned.g
|
||||||
gem 'acts_as_tree'
|
gem 'acts_as_tree'
|
||||||
gem 'acts_as_configurable', git: 'git://github.com/bwalding/acts_as_configurable.git'
|
gem 'acts_as_configurable', git: 'git://github.com/bwalding/acts_as_configurable.git'
|
||||||
gem 'resque'
|
gem 'resque'
|
||||||
|
gem 'whenever', :require => false # For defining cronjobs, see config/schedule.rb
|
||||||
|
|
||||||
group :production do
|
group :production do
|
||||||
gem 'exception_notification', :require => 'exception_notifier'
|
gem 'exception_notification', :require => 'exception_notifier'
|
||||||
|
|
|
@ -57,6 +57,7 @@ GEM
|
||||||
erubis (>= 2.7.0)
|
erubis (>= 2.7.0)
|
||||||
binding_of_caller (0.6.8)
|
binding_of_caller (0.6.8)
|
||||||
builder (3.0.4)
|
builder (3.0.4)
|
||||||
|
chronic (0.9.0)
|
||||||
client_side_validations (3.1.4)
|
client_side_validations (3.1.4)
|
||||||
coderay (1.0.8)
|
coderay (1.0.8)
|
||||||
coffee-rails (3.2.2)
|
coffee-rails (3.2.2)
|
||||||
|
@ -111,7 +112,7 @@ GEM
|
||||||
activesupport (~> 3.1)
|
activesupport (~> 3.1)
|
||||||
polyamorous (~> 0.5.0)
|
polyamorous (~> 0.5.0)
|
||||||
mime-types (1.19)
|
mime-types (1.19)
|
||||||
multi_json (1.3.7)
|
multi_json (1.5.0)
|
||||||
mysql2 (0.3.11)
|
mysql2 (0.3.11)
|
||||||
pdf-reader (1.2.0)
|
pdf-reader (1.2.0)
|
||||||
Ascii85 (~> 1.0.0)
|
Ascii85 (~> 1.0.0)
|
||||||
|
@ -206,6 +207,9 @@ GEM
|
||||||
multi_json (~> 1.0, >= 1.0.2)
|
multi_json (~> 1.0, >= 1.0.2)
|
||||||
vegas (0.1.11)
|
vegas (0.1.11)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
|
whenever (0.8.1)
|
||||||
|
activesupport (>= 2.3.4)
|
||||||
|
chronic (>= 0.6.3)
|
||||||
wikicloth (0.8.0)
|
wikicloth (0.8.0)
|
||||||
builder
|
builder
|
||||||
expression_parser
|
expression_parser
|
||||||
|
@ -244,4 +248,5 @@ DEPENDENCIES
|
||||||
therubyracer
|
therubyracer
|
||||||
twitter-bootstrap-rails
|
twitter-bootstrap-rails
|
||||||
uglifier (>= 1.0.3)
|
uglifier (>= 1.0.3)
|
||||||
|
whenever
|
||||||
wikicloth
|
wikicloth
|
||||||
|
|
15
config/schedule.rb
Normal file
15
config/schedule.rb
Normal 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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue