Updates now that we have updated our_address() to differentiate public/mailer advertised addresses with all our addresses
This commit is contained in:
@@ -115,12 +115,12 @@ class NodelistImport implements ShouldQueue
|
||||
}
|
||||
|
||||
$file_crc = (int)$matches[4];
|
||||
$do = Domain::where('name',strtolower($matches[1] ?: $this->domain))->single();
|
||||
$do = Domain::where('name',strtolower($this->domain ?: $matches[1]))->single();
|
||||
|
||||
if (! $do) {
|
||||
Log::error(sprintf('%s:! Domain not found [%s].',static::LOGKEY,strtolower($matches[1] ?: $this->domain)));
|
||||
|
||||
throw new \Exception('Nodelist Domain not found: '.$this->file);
|
||||
throw new \Exception('Nodelist Domain not found: '.($this->domain ?: $matches[1]));
|
||||
}
|
||||
|
||||
$date = Carbon::createFromFormat('D, M d, Y H:i',$matches[2].'0:00');
|
||||
@@ -143,6 +143,8 @@ class NodelistImport implements ShouldQueue
|
||||
elseif ($no->addresses->count()) {
|
||||
Log::error(sprintf('%s:! Nodelist [%s] for [%s] has existing records [%d]',self::LOGKEY,$date,$do->name,$no->addresses->count()));
|
||||
|
||||
// This can occur when a nodelist doesnt change, but is sent out anyway
|
||||
// @todo Need to immediately fail this job
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -291,7 +293,7 @@ class NodelistImport implements ShouldQueue
|
||||
Log::info(sprintf('%s:- Processing existing address [%s] (%d)',self::LOGKEY,$ao->ftn,$ao->id));
|
||||
|
||||
// If the address is linked to a user's system, or our system, we'll not process it any further
|
||||
if (our_address()->contains($ao->id)) {
|
||||
if (our_address(NULL,FALSE)->contains($ao->id)) {
|
||||
Log::info(sprintf('%s:! Limiting update to an address belonging to me',self::LOGKEY));
|
||||
$protect = TRUE;
|
||||
|
||||
@@ -563,7 +565,7 @@ class NodelistImport implements ShouldQueue
|
||||
->filter(fn($item)=>(! $item->point_id))
|
||||
->pluck('id')
|
||||
->diff($no->addresses->pluck('id'))
|
||||
->diff(our_address($do)->pluck('id'))
|
||||
->diff(our_address($do,FALSE)->pluck('id'))
|
||||
->diff(our_nodes($do)->pluck('id'));
|
||||
|
||||
$remove = Address::whereIn('id',$remove)->get();
|
||||
|
Reference in New Issue
Block a user