I have this task:
task :send_emails => :environment do
Dir.chdir(Rails.root)
ActionMailer::ARSendmail.run(['-o'])
end
I try to run it as a cronjob, or in console. The emails table is full, but no emails are coming out.
The query that I get in the log is very strange:
Eventhough I run production mode, the log is created in development.log
The query that I get there is:
SELECT
emails
.* FROMemails
WHERE (last_send_attempt > 0 and created_on < '2015-07-12 23:36:49')
But today is 2015-07-19. Why does it go to an older date?
It seems that in the query it gets the emails, it says:
ar_sendmail: found 1000 emails to send
but it does nothing.
???
It seems to me that the log has not used an incorrect date. But rather, you are looking at an old entry.