Skip to content

Commit

Permalink
add whenever and schedule command
Browse files Browse the repository at this point in the history
  • Loading branch information
gabimartini committed Jul 16, 2024
1 parent 3b416f4 commit dd65d97
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.7'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'bootsnap', '>= 1.4.2', require: false
gem 'whenever', require: false

gem 'kaminari'
gem 'devise'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ GEM
xpath (~> 3.2)
case_transform (0.2)
activesupport
chronic (0.10.2)
closure_tree (7.4.0)
activerecord (>= 4.2.10)
with_advisory_lock (>= 4.0.0)
Expand Down Expand Up @@ -416,6 +417,8 @@ GEM
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whenever (1.0.0)
chronic (>= 0.6.3)
with_advisory_lock (4.6.0)
activerecord (>= 4.2)
xpath (3.2.0)
Expand Down Expand Up @@ -480,6 +483,7 @@ DEPENDENCIES
uk_postcode
web-console (>= 3.3.0)
webpacker (~> 5.0)
whenever

RUBY VERSION
ruby 3.0.3p157
Expand Down
24 changes: 24 additions & 0 deletions config/schedule.rb
Original file line number Diff line number Diff line change
@@ -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

every 5.minute do
command "docker compose exec outpost bin/rails build_public_index "
end

# Learn more: http://github.com/javan/whenever

0 comments on commit dd65d97

Please sign in to comment.