Only queue messages if the packet has too many
This commit is contained in:
@@ -133,6 +133,10 @@ final class Receive extends Item
|
||||
break;
|
||||
}
|
||||
|
||||
// Queue messages if there are too many in the packet.
|
||||
if ($queue = ($po->count() > config('app.queue_msgs')))
|
||||
Log::info(sprintf('%s: - Messages will be sent to the queue for processing',self::LOGKEY));
|
||||
|
||||
foreach ($po as $msg) {
|
||||
Log::info(sprintf('%s: - Mail from [%s] to [%s]',self::LOGKEY,$msg->fftn,$msg->tftn));
|
||||
|
||||
@@ -140,7 +144,10 @@ final class Receive extends Item
|
||||
// @todo validate that the packet's zone is in the domain.
|
||||
|
||||
// Dispatch job.
|
||||
ProcessPacket::dispatch($msg);
|
||||
if ($queue)
|
||||
ProcessPacket::dispatch($msg);
|
||||
else
|
||||
ProcessPacket::dispatchSync($msg);
|
||||
}
|
||||
|
||||
if ($po->errors->count()) {
|
||||
|
Reference in New Issue
Block a user