send mail from ar_mailer is not working

54 views Asked by At

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:

  1. Eventhough I run production mode, the log is created in development.log

  2. The query that I get there is:

    SELECT emails.* FROM emails 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.

???

2

There are 2 answers

1
AudioBubble On

It seems to me that the log has not used an incorrect date. But rather, you are looking at an old entry.

0
AudioBubble On

I too think that you are looking at the wrong log or the log is not working.