From f947d0bbb2a2943f569cc4828a2c580009f5260e Mon Sep 17 00:00:00 2001 From: ailobe Date: Wed, 9 Jan 2019 17:39:56 +0100 Subject: [PATCH 1/2] Add whenever gem --- Gemfile | 1 + Gemfile.lock | 4 ++++ config/schedule.rb | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 config/schedule.rb diff --git a/Gemfile b/Gemfile index 44ef458..279ef57 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem 'graphql', '1.8.10' gem 'delayed_job_active_record' gem 'daemons' +gem "whenever" gem 'puma', '~> 3.0' gem 'uglifier', '>= 4.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index b4a6ff3..1a9e8a5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -123,6 +123,7 @@ GEM cells (>= 4.1.6, < 5.0.0) childprocess (0.9.0) ffi (~> 1.0, >= 1.0.11) + chronic (0.10.2) coderay (1.1.2) coercible (1.0.0) descendants_tracker (~> 0.0.1) @@ -726,6 +727,8 @@ GEM websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.3) + whenever (0.10.0) + chronic (>= 0.6.3) wicked (1.3.3) railties (>= 3.0.7) wisper (2.0.0) @@ -758,6 +761,7 @@ DEPENDENCIES spring-watcher-listen (~> 2.0.0) uglifier (>= 4.0.0) web-console + whenever RUBY VERSION ruby 2.5.1p57 diff --git a/config/schedule.rb b/config/schedule.rb new file mode 100644 index 0000000..3036285 --- /dev/null +++ b/config/schedule.rb @@ -0,0 +1,24 @@ +# 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, at: '2:00 am' do # 1.minute 1.day 1.week 1.month 1.year is also supported + rake "decidim:metrics:all" +end From 40076ce26a5140290cf508fd7b4547c0b4008fce Mon Sep 17 00:00:00 2001 From: ailobe Date: Fri, 11 Jan 2019 09:59:38 +0100 Subject: [PATCH 2/2] Update schedule.rb --- config/schedule.rb | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/config/schedule.rb b/config/schedule.rb index 3036285..99ace95 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -1,24 +1,3 @@ -# 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, at: '2:00 am' do # 1.minute 1.day 1.week 1.month 1.year is also supported +every 1.day, at: '2:00 am' do # 1.minute 1.day 1.week 1.month 1.year is also supported rake "decidim:metrics:all" end