Permalink
Browse files

add whenever to run Tag.recount

  • Loading branch information...
1 parent 716ef54 commit a46d40966cd2e78c8f3906c152502bce9fe7cb74 @chloerei committed Mar 11, 2012
Showing with 27 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +3 −0 config/deploy.rb
  3. +23 −0 config/schedule.rb
View
@@ -31,6 +31,7 @@ group :assets do
end
group :development do
+ gem 'whenever', :require => false
gem 'capistrano', :require => false
end
View
@@ -4,6 +4,9 @@
require 'bundler/capistrano'
+set :whenever_command, "bundle exec whenever"
+require "whenever/capistrano"
+
set :application, "codecampo.com"
set :repository, "git://github.com/chloerei/code_campo.git"
set :scm, :git
View
@@ -0,0 +1,23 @@
+# Use this file to easily define all of your cron jobs.
+#
+# It's helpful, but not entirely necessary to understand cron before proceeding.
+# http://en.wikipedia.org/wiki/Cron
+
+# Example:
+#
+# set :output, "/path/to/my/cron_log.log"
+#
+# every 2.hours do
+# command "/usr/bin/some_great_command"
+# runner "MyModel.some_method"
+# rake "some:great:rake:task"
+# end
+#
+# every 4.days do
+# runner "AnotherModel.prune_old_records"
+# end
+
+# Learn more: http://github.com/javan/whenever
+every 1.day do
+ runner "Tag.recount"
+end

0 comments on commit a46d409

Please sign in to comment.