event_news/config/initializers/scheduler.rb

10 lines
260 B
Ruby
Raw Permalink Normal View History

2022-01-21 02:09:31 +00:00
require 'rufus-scheduler'
scheduler = Rufus::Scheduler.new
#return if defined?(Rails::Console) || Rails.env.test? || File.split($0).last == 'rake'
scheduler.cron '43 2 * * *' do
system('bundle exec rake event_news:remove_preview_event_news')
end