You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
681 B
19 lines
681 B
namespace :monitor do
|
|
desc "executes the monitoring logic"
|
|
task :run => :environment do
|
|
Rails.logger = Logger.new(STDOUT)
|
|
Rails.logger.level = Logger::INFO
|
|
Rails.logger.info "About to check #{ENV["EMAIL"]} inbox..."
|
|
res = MonitorInbox.call!
|
|
Rails.logger.info "A total of #{res.analyzed_emails_count} new emails were analyzed"
|
|
Rails.logger.info "A total of #{res.actions_executed_count} actions were triggered"
|
|
end
|
|
|
|
desc "deletes all log entries"
|
|
task :clear_log => :environment do
|
|
Rails.logger = Logger.new(STDOUT)
|
|
Rails.logger.level = Logger::INFO
|
|
Rails.logger.info "About to clear all log entries"
|
|
ActionLog.delete_all
|
|
end
|
|
end
|
|
|