Created
May 23, 2014 11:43
-
-
Save rafaqz/e204bed024f6e8e8f463 to your computer and use it in GitHub Desktop.
Patches drupal message subscribe module to fix queue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/message_subscribe.module b/message_subscribe.module | |
index da35358..026a2dc 100755 | |
--- a/message_subscribe.module | |
+++ b/message_subscribe.module | |
@@ -152,30 +152,26 @@ function message_subscribe_send_message($entity_type, $entity, Message $message, | |
message_notify_send_message($cloned_message, $options, $notifier_name); | |
// Check we didn't timeout. | |
- if ($use_queue && $subscribe_options['queue']['end time'] && time() < $subscribe_options['queue']['end time']) { | |
- continue 2; | |
+ if ($use_queue && $subscribe_options['queue']['end time'] && time() > $subscribe_options['queue']['end time']) { | |
+ // We timed out so add remaining items back to the queue. | |
+ $task = array( | |
+ 'mid' => $message->mid, | |
+ 'entity_type' => $entity_type, | |
+ 'entity_id' => $id, | |
+ 'notify_options' => $notify_options, | |
+ 'subscribe_options' => $subscribe_options, | |
+ 'context' => $context, | |
+ 'uid' => $last_uid, | |
+ ); | |
+ | |
+ $task['subscribe_options']['last uid'] = $last_uid; | |
+ | |
+ // Create a new queue item, with the last user ID. | |
+ return $queue->createItem($task); | |
} | |
} | |
} | |
- if ($use_queue) { | |
- // Add item to the queue. | |
- $task = array( | |
- 'mid' => $message->mid, | |
- 'entity_type' => $entity_type, | |
- 'entity_id' => $id, | |
- 'notify_options' => $notify_options, | |
- 'subscribe_options' => $subscribe_options, | |
- 'context' => $context, | |
- 'uid' => $last_uid, | |
- ); | |
- | |
- $task['subscribe_options']['last uid'] = $last_uid; | |
- | |
- // Create a new queue item, with the last user ID. | |
- $queue->createItem($task); | |
- } | |
- | |
return $message; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment