Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix: Email processing occurs in the wrong order.

The purpose of the email queue is to allow batch processing emails to speed up web page response.

Our aim should be to ensure the email table is as close to empty at all times,
(if cron jobs are not used, we try to clear the table at the end of the web page request)

Therefore:

a) There's no need to define a custom sort order for the table. In the ideal world, where the table is empty, the sort order is going to be irrelevant

b) Emails should be sent in the order they are generated. Therefore, they should always be processed in ASCending order.

After this, I plan on looking at how we handle emails that previously errored to ensure that users are notified of problems in some way, and we avoid performance issues, as email troubleshooting is one of our more popular support issues with end users
  • Loading branch information...
commit 13c209648ee19e39559aec1a999af8a19b53ff74 1 parent fd4c97b
@grangeway grangeway authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 core/email_queue_api.php
View
5 core/email_queue_api.php
@@ -192,13 +192,12 @@ function email_queue_delete( $p_email_id ) {
/**
* Get array of email queue id's
- * @param string $p_sort_order Either 'ASC' or 'DESC' (defaults to DESC).
* @return array
*/
-function email_queue_get_ids( $p_sort_order = 'DESC' ) {
+function email_queue_get_ids() {
$t_email_table = db_get_table( 'email' );
- $t_query = 'SELECT email_id FROM ' . $t_email_table . ' ORDER BY email_id ' . $p_sort_order;
+ $t_query = 'SELECT email_id FROM ' . $t_email_table . ' ORDER BY email_id ASC';
$t_result = db_query_bound( $t_query );
$t_ids = array();
Please sign in to comment.
Something went wrong with that request. Please try again.