Change the way we figure out zones in packets, some packet testing, fix Echomail import
This commit is contained in:
@@ -16,7 +16,7 @@ class ProcessPacket extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'packet:process {pkt : Packet to process} {domain : Domain the packet is from}';
|
||||
protected $signature = 'packet:process {pkt : Packet to process} {domain? : Domain the packet is from}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@@ -34,14 +34,14 @@ class ProcessPacket extends Command
|
||||
public function handle()
|
||||
{
|
||||
$f = new File($this->argument('pkt'));
|
||||
$d = Domain::where('name',$this->argument('domain'))->singleOrFail();
|
||||
$d = $this->argument('domain') ? Domain::where('name',$this->argument('domain'))->singleOrFail() : NULL;
|
||||
|
||||
foreach (Packet::open($f,$d) as $msg) {
|
||||
// @todo Quick check that the packet should be processed by us.
|
||||
// @todo validate that the packet's zone is in the domain.
|
||||
|
||||
// Dispatch job.
|
||||
Job::dispatch($msg);
|
||||
Job::dispatchSync($msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user