Additional fixes for 14616471
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 33s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m35s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
Deon George 2025-04-17 14:18:15 +10:00
parent 99dc13b297
commit 9590ddcadb
2 changed files with 12 additions and 18 deletions

View File

@ -177,7 +177,7 @@ class AddressPoll implements ShouldQueue, ShouldBeUnique
Skip::unless(function(): bool { Skip::unless(function(): bool {
if ($this->force if ($this->force
|| ($this->ao->echomailWaitingCount() > 0) || ($this->ao->echomailWaitingCount() > 0)
|| ($this->ao->fileWaitingCount() > 0) || ($this->ao->filesWaitingCount() > 0)
|| ($this->ao->netmailWaitingCount() > 0)) { || ($this->ao->netmailWaitingCount() > 0)) {
return TRUE; return TRUE;

View File

@ -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();
} }
@ -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();
} }