From 21d3ff59186173786a840740a1813b4038afd6f5 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 6 Nov 2024 22:44:21 +1100 Subject: [PATCH] Limit address idle only to addresses where we are the parent --- app/Jobs/AddressIdle.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Jobs/AddressIdle.php b/app/Jobs/AddressIdle.php index 02c5d4d..a7cd73f 100644 --- a/app/Jobs/AddressIdle.php +++ b/app/Jobs/AddressIdle.php @@ -196,6 +196,7 @@ class AddressIdle implements ShouldQueue return collect(); $age = Carbon::now()->subDays($days)->endOfDay(); + $ours = our_address($do)->pluck('ftn'); return Address::FTN() ->ActiveFTN() @@ -208,6 +209,7 @@ class AddressIdle implements ShouldQueue ->whereRaw(sprintf('((role IS NULL) OR ((role & %d) = 0))',Address::NODE_KEEP)) ->join('systems',['systems.id'=>'addresses.system_id']) //->with(['system','zone.domain']) - ->get(); + ->get() + ->filter(fn($item)=>$ours->contains($item->parent()?->ftn)); } } \ No newline at end of file