When sending, make sure we check to make sure result is NULL as well, becuase if its cancelled, sent will be NULL but result will be cancelled

This commit is contained in:
james 2010-02-11 15:59:41 +00:00
parent d8375c0c5f
commit a1865e267b

View File

@ -32,7 +32,7 @@ if(!$config['emailqueue_lock']) {
//loop forever, but not really, it'll get break'd as soon as there's nothing left to send
while(true) {
$q=mysql_query("SELECT * FROM emailqueue_recipients WHERE sent IS NULL LIMIT 1");
$q=mysql_query("SELECT * FROM emailqueue_recipients WHERE sent IS NULL AND result IS NULL LIMIT 1");
if(mysql_num_rows($q)) {
$r=mysql_fetch_object($q);
$eq=mysql_query("SELECT * FROM emailqueue WHERE id='$r->emailqueue_id'");