Commit 10f237bd authored by micmania1's avatar micmania1

Fixed memory and cpu overload.

parent cb6ef8b8
......@@ -49,7 +49,7 @@ class NewsletterSendController extends BuildTask {
Usage: dev/tasks/NewsletterSendController?newsletter=#';
static function inst() {
if(!self::$inst) self::$inst = new NewsletterSendController();
if(!self::$inst) self::$inst = Injector::inst()->create('NewsletterSendController');
return self::$inst;
}
......@@ -91,7 +91,7 @@ class NewsletterSendController extends BuildTask {
"newsletter",
new MethodInvocationMessage('NewsletterSendController', "process_queue_invoke", $newsletterID)
);
MessageQueue::consume_on_shutdown();
} else {
// Do the sending in real-time, if there is not MessageQueue to do it out-of-process.
......
......@@ -223,13 +223,13 @@ class Newsletter extends DataObject implements CMSPreviewable{
);
//Create the Sent To Queue grid
if (class_exists("GridFieldAjaxRefresh") && $this->SendRecipientQueue()->exists()) {
//only use auto-refresh if there is a send out currently in-progress, otherwise no-point
if ($this->SendRecipientQueue()->filter(
array('Status'=>array('Scheduled','InProgress')))->count() > 0) {
$gridFieldConfig->addComponent(new GridFieldAjaxRefresh(5000,true));
}
}
// if (class_exists("GridFieldAjaxRefresh") && $this->SendRecipientQueue()->exists()) {
// //only use auto-refresh if there is a send out currently in-progress, otherwise no-point
// if ($this->SendRecipientQueue()->filter(
// array('Status'=>array('Scheduled','InProgress')))->count() > 0) {
// $gridFieldConfig->addComponent(new GridFieldAjaxRefresh(5000,true));
// }
// }
$sendRecipientGrid = GridField::create(
'SendRecipientQueue',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment