From e294ceaaba42a0dcaaa05b7a22c2c165da4a0c19 Mon Sep 17 00:00:00 2001 From: Luiz Picolo Date: Thu, 7 Oct 2021 20:32:28 -0400 Subject: [PATCH] Added and Configured gem Whenever --- Gemfile | 3 ++- config/schedule.rb | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 config/schedule.rb diff --git a/Gemfile b/Gemfile index 7c8fdaa..012f7f2 100644 --- a/Gemfile +++ b/Gemfile @@ -12,4 +12,5 @@ gem 'chartkick' gem 'rerun' gem 'sqlite3' gem 'rake' -gem 'puma' \ No newline at end of file +gem 'puma'gem 'whenever', require: false + diff --git a/config/schedule.rb b/config/schedule.rb new file mode 100644 index 0000000..c78bd47 --- /dev/null +++ b/config/schedule.rb @@ -0,0 +1,10 @@ +set :environment, ENV["RACK_ENV"] +set :output, '/var/log/cron.log' + +ENV.each_key do |key| + env key.to_sym, ENV[key] +end + +every 5.minutes do + rake "rate:save" +end \ No newline at end of file