Commit b9ef2ea73437caa9525c7da072911a8ed631076d
1 parent
38161c46
Exists in
staging
and in
26 other branches
[search-improvements] Wrtie/clear whenever cronjob together with rails server
Showing
3 changed files
with
7 additions
and
3 deletions
Show diff stats
config/schedule.rb
| ... | ... | @@ -18,9 +18,8 @@ |
| 18 | 18 | # end |
| 19 | 19 | |
| 20 | 20 | # Learn more: http://github.com/javan/whenever |
| 21 | -# | |
| 22 | -set :environment, 'development' | |
| 23 | -set :output, "/home/rodrigo/noosfero/log/cron.log" | |
| 21 | + | |
| 22 | +set :output, "log/cron.log" | |
| 24 | 23 | |
| 25 | 24 | every 1.minute do |
| 26 | 25 | runner "SearchTerm.calculate_scores" | ... | ... |
script/development
| ... | ... | @@ -7,6 +7,7 @@ export RAILS_ENV=development |
| 7 | 7 | stop() { |
| 8 | 8 | ./script/delayed_job stop |
| 9 | 9 | ./script/feed-updater stop |
| 10 | + whenever --clear-crontab | |
| 10 | 11 | exit |
| 11 | 12 | } |
| 12 | 13 | |
| ... | ... | @@ -15,6 +16,7 @@ start() { |
| 15 | 16 | ./script/feed-updater start |
| 16 | 17 | ./script/delayed_job start |
| 17 | 18 | trap stop INT TERM |
| 19 | + whenever --write-crontab --set 'environment=development' | |
| 18 | 20 | rails s $@ |
| 19 | 21 | } |
| 20 | 22 | ... | ... |
script/production
| ... | ... | @@ -29,6 +29,7 @@ do_start() { |
| 29 | 29 | rake db:migrate SCHEMA=/dev/null |
| 30 | 30 | clear_cache |
| 31 | 31 | environments_loop start |
| 32 | + whenever --write-crontab --set 'environment=production' | |
| 32 | 33 | ruby -S thin -C config/thin.yml start |
| 33 | 34 | } |
| 34 | 35 | |
| ... | ... | @@ -43,6 +44,8 @@ do_stop() { |
| 43 | 44 | |
| 44 | 45 | environments_loop stop || |
| 45 | 46 | stop_via_pid_file tmp/pids/delayed_job.pid tmp/pids/delayed_job.*.pid tmp/pids/feed-updater.*.pid |
| 47 | + | |
| 48 | + whenever --clear-crontab | |
| 46 | 49 | } |
| 47 | 50 | |
| 48 | 51 | stop_via_pid_file() { | ... | ... |