Additional fixes for 14616471
This commit is contained in:
parent
99dc13b297
commit
c6458219bf
@ -170,20 +170,16 @@ class AddressPoll implements ShouldQueue, ShouldBeUnique
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
// If there is no mail anymore, no need trying
|
||||||
}),
|
if ((! $this->force)
|
||||||
|
&& ($this->ao->echomailWaitingCount() === 0)
|
||||||
// If there is no mail anymore, no need trying
|
&& ($this->ao->filesWaitingCount() === 0)
|
||||||
Skip::unless(function(): bool {
|
&& ($this->ao->netmailWaitingCount() === 0)) {
|
||||||
if ($this->force
|
Log::info(sprintf('%s:/ Nothing waiting - abandoning poll [%s]',self::LOGKEY,$this->ao->ftn));
|
||||||
|| ($this->ao->echomailWaitingCount() > 0)
|
|
||||||
|| ($this->ao->fileWaitingCount() > 0)
|
|
||||||
|| ($this->ao->netmailWaitingCount() > 0)) {
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::info(sprintf('%s:/ Nothing waiting - abandoning poll [%s]',self::LOGKEY,$this->ao->ftn));
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
@ -976,14 +976,13 @@ class Address extends Model
|
|||||||
/**
|
/**
|
||||||
* Echomail waiting to be sent to this address
|
* Echomail waiting to be sent to this address
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function echomailWaiting(): Collection
|
public function echomailWaiting(): Builder
|
||||||
{
|
{
|
||||||
return Echomail::Uncollected()
|
return Echomail::Uncollected()
|
||||||
->where('address_id',$this->id)
|
->where('address_id',$this->id)
|
||||||
->orderby('id')
|
->orderby('id');
|
||||||
->get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -993,22 +992,20 @@ class Address extends Model
|
|||||||
*/
|
*/
|
||||||
public function echomailWaitingCount(): int
|
public function echomailWaitingCount(): int
|
||||||
{
|
{
|
||||||
return Echomail::Uncollected()
|
return $this->echomailWaiting()
|
||||||
->where('address_id',$this->id)
|
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Files waiting to be sent to this address
|
* Files waiting to be sent to this address
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return Builder
|
||||||
*/
|
*/
|
||||||
public function filesWaiting(): Collection
|
public function filesWaiting(): Builder
|
||||||
{
|
{
|
||||||
return File::Uncollected()
|
return File::Uncollected()
|
||||||
->where('address_id',$this->id)
|
->where('address_id',$this->id)
|
||||||
->orderby('id')
|
->orderby('id');
|
||||||
->get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1018,8 +1015,7 @@ class Address extends Model
|
|||||||
*/
|
*/
|
||||||
public function filesWaitingCount(): int
|
public function filesWaitingCount(): int
|
||||||
{
|
{
|
||||||
return File::Uncollected()
|
return $this->filesWaiting()
|
||||||
->where('address_id',$this->id)
|
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1094,7 +1090,7 @@ class Address extends Model
|
|||||||
if ($count > $this->system->batch_files)
|
if ($count > $this->system->batch_files)
|
||||||
Log::notice(sprintf('%s:= Only sending [%d] files for [%s]',self::LOGKEY,$this->system->batch_files,$this->ftn));
|
Log::notice(sprintf('%s:= Only sending [%d] files for [%s]',self::LOGKEY,$this->system->batch_files,$this->ftn));
|
||||||
|
|
||||||
return $num->take($this->system->batch_files);
|
return $num->take($this->system->batch_files)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Collection;
|
return new Collection;
|
||||||
@ -1169,16 +1165,14 @@ class Address extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count of echomail waiting to be sent to this address
|
* Count of netmail waiting to be sent to this address
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function netmailWaitingCount(): int
|
public function netmailWaitingCount(): int
|
||||||
{
|
{
|
||||||
return Netmail::Uncollected()
|
return $this->netmailWaiting()
|
||||||
->whereIn('tftn_id',$this->downlinks()
|
|
||||||
->add($this)
|
|
||||||
->pluck('id'))
|
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user