public
Created

Our worker task for emails

  • Download Gist
Email worker
1 2 3 4 5 6 7 8 9 10 11 12 13
desc 'Work email queue'
task :emails => :environment do
`if [ ! -d "pids" ]; then mkdir pids; fi; echo "#{Process.pid}" > #{Rails.root}/pids/emails.pid`
Minion.job "emails" do |args|
logger.info "[#{Time.now}] Recieved queued item"
begin
UserMailer.deliver(args)
rescue Exception => exception
logger.info "Error, #{exception}"
raise exception
end
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.