From b8f0b11c05922064004fcbe19852f635b0904849 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 29 Sep 2024 13:16:23 +1000 Subject: [PATCH] Handle delisting when last_seen is blank (node hasnt polled) --- app/Jobs/AddressIdle.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/AddressIdle.php b/app/Jobs/AddressIdle.php index f3683f2..b1f8286 100644 --- a/app/Jobs/AddressIdle.php +++ b/app/Jobs/AddressIdle.php @@ -59,7 +59,7 @@ class AddressIdle implements ShouldQueue continue; // Validate that the last seen was infact that long ago - if ($ao->system->last_seen->greaterThan($age)) + if ($ao->system->last_seen && $ao->system->last_seen->greaterThan($age)) continue; Log::info(sprintf('%s:- Delisting [%s], not seen for [%d] days',self::LOGKEY,$ao->ftn,config('fido.idle.delist'))); @@ -123,7 +123,7 @@ class AddressIdle implements ShouldQueue continue; // Validate that the last seen was infact that long ago - if ($ao->system->last_seen->greaterThan($age)) + if ($ao->system->last_seen && $ao->system->last_seen->greaterThan($age)) continue; Log::info(sprintf('%s:- Marking [%s] as DOWN, not seen for [%d] days',self::LOGKEY,$ao->ftn,config('fido.idle.down'))); @@ -168,7 +168,7 @@ class AddressIdle implements ShouldQueue continue; // Validate that the last seen was infact that long ago - if ($ao->system->last_seen->greaterThan($age)) + if ($ao->system->last_seen && $ao->system->last_seen->greaterThan($age)) continue; $contact = FALSE;