Leverage Redis and queue to handle large packets

This commit is contained in:
Deon George
2021-08-24 23:42:03 +10:00
parent 1398ecff2d
commit d86d90cdeb
6 changed files with 97 additions and 10 deletions

View File

@@ -122,7 +122,7 @@ final class Receive extends Item
// Check the messages are from the uplink
if ($this->ao->system->addresses->search(function($item) use ($po) { return $item->id == $po->fftn_o->id; }) === FALSE) {
Log::error(sprintf('%s: ! Packet [%s] is not from this link? [%d]',self::LOGKEY,$this->fftn_o->ftn,$this->ao->system_id));
Log::error(sprintf('%s: ! Packet [%s] is not from this link? [%d]',self::LOGKEY,$po->fftn_o->ftn,$this->ao->system_id));
break;
}
@@ -133,14 +133,14 @@ final class Receive extends Item
break;
}
foreach ($po->messages as $msg) {
foreach ($po as $msg) {
Log::info(sprintf('%s: - Mail from [%s] to [%s]',self::LOGKEY,$msg->fftn,$msg->tftn));
// @todo Quick check that the packet should be processed by us.
// @todo validate that the packet's zone is in the domain.
// Dispatch job.
ProcessPacket::dispatchSync($msg);
ProcessPacket::dispatch($msg);
}
if ($po->errors->count()) {