mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-02 06:51:40 +00:00
After moving the remaining tasks from schedule.rb to sidekiq.yml, we can remove whenever and won't rely on cron any more. That will simplify the setup and migration to a new server.
21 lines
693 B
Ruby
21 lines
693 B
Ruby
# Force manual loading of rails application to get all env variables from dotenv-rails when running whenever cmd
|
|
require File.expand_path('../environment', __FILE__)
|
|
|
|
require 'whenever'
|
|
require 'yaml'
|
|
|
|
# Learn more: http://github.com/javan/whenever
|
|
|
|
env "MAILTO", ENV["SCHEDULE_NOTIFICATIONS"] if ENV["SCHEDULE_NOTIFICATIONS"]
|
|
|
|
# If we use -e with a file containing specs, rspec interprets it and filters out our examples
|
|
job_type :run_file, "cd :path; :environment_variable=:environment bundle exec script/rails runner :task :output"
|
|
|
|
every 1.day, at: '2:45am' do
|
|
rake 'db2fog:clean' if ENV['S3_BACKUPS_BUCKET']
|
|
end
|
|
|
|
every 4.hours do
|
|
rake 'db2fog:backup' if ENV['S3_BACKUPS_BUCKET']
|
|
end
|