Commit eebd25df by Tran Hoang Viet

VietTH: Add rake update_price to crontab

parent 2f3c0762
...@@ -5,6 +5,7 @@ require 'capistrano/bundler' ...@@ -5,6 +5,7 @@ require 'capistrano/bundler'
require 'capistrano/rails/assets' require 'capistrano/rails/assets'
require 'capistrano/rails/migrations' require 'capistrano/rails/migrations'
require 'capistrano3/unicorn' require 'capistrano3/unicorn'
require 'whenever/capistrano'
# Load custom tasks from `lib/capistrano/tasks' if you have any defined # Load custom tasks from `lib/capistrano/tasks' if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
\ No newline at end of file
source 'http://rubygems.org' source 'http://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3' gem 'rails', '4.2.3'
# Use mysql as the database for Active Record # Use mysql as the database for Active Record
...@@ -76,6 +74,7 @@ gem 'mini_magick', '~> 3.8.1' ...@@ -76,6 +74,7 @@ gem 'mini_magick', '~> 3.8.1'
# Background job # Background job
gem 'sidekiq', '~> 3.4.1' gem 'sidekiq', '~> 3.4.1'
gem 'whenever', '~> 0.9.4'
# pagination # pagination
gem 'kaminari', '~> 0.16.3' gem 'kaminari', '~> 0.16.3'
......
...@@ -75,6 +75,7 @@ GEM ...@@ -75,6 +75,7 @@ GEM
redis redis
celluloid (0.16.0) celluloid (0.16.0)
timers (~> 4.0.0) timers (~> 4.0.0)
chronic (0.10.2)
coderay (1.1.0) coderay (1.1.0)
coffee-rails (4.1.0) coffee-rails (4.1.0)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
...@@ -321,6 +322,8 @@ GEM ...@@ -321,6 +322,8 @@ GEM
binding_of_caller (>= 0.7.2) binding_of_caller (>= 0.7.2)
railties (>= 4.0) railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0) sprockets-rails (>= 2.0, < 4.0)
whenever (0.9.4)
chronic (>= 0.6.3)
PLATFORMS PLATFORMS
ruby ruby
...@@ -372,6 +375,7 @@ DEPENDENCIES ...@@ -372,6 +375,7 @@ DEPENDENCIES
unicorn unicorn
vacuum (~> 1.3.0) vacuum (~> 1.3.0)
web-console (~> 2.0) web-console (~> 2.0)
whenever (~> 0.9.4)
BUNDLED WITH BUNDLED WITH
1.10.5 1.10.5
...@@ -21,6 +21,8 @@ set :linked_dirs, fetch(:linked_dirs, []).push( ...@@ -21,6 +21,8 @@ set :linked_dirs, fetch(:linked_dirs, []).push(
'public/uploads' 'public/uploads'
) )
set :whenever_identifier, ->{ fetch(:rails_env) }
after 'deploy:publishing', 'deploy:restart' after 'deploy:publishing', 'deploy:restart'
namespace :deploy do namespace :deploy do
......
# 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 :hour do
rake "aws:update_price"
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment