Ecodev / newsletter

TYPO3 extension to send newsletter
https://extensions.typo3.org/extension/newsletter/
25 stars 26 forks source link

Prevent Queue Deadlocks #170

Closed SicorDev closed 5 years ago

SicorDev commented 5 years ago

Hi there,

in the newsletter Repository method findAllNewsletterAndEmailUidToSend the WHERE clause looks like this:

WHERE tx_newsletter_domain_model_email.begin_time = 0

This poses two problems:

  1. If sending the mail between start and stop fails, it'll hang there for all eternity.
  2. Even if you try to delete the mail, the query will still find it.

My suggested fix for both issues is:

WHERE tx_newsletter_domain_model_email.end_time = 0 AND tx_newsletter_domain_model_email.deleted = 0

That way it will try sending again next time (If you fixed a typo e.g.) and simply deleting the mail will let the queue continue.

BTW: A way to emergency stop or pause newsletter would also be a nice feature I think.