Fix for EMSI aborting with $rc undefined, Fix for idle nodes updates failing on updated_at column and change text used when nodes have never polled

This commit is contained in:
2025-01-29 08:45:46 +11:00
parent 35c5b3da8d
commit 8cc561ea2b
4 changed files with 28 additions and 16 deletions

View File

@@ -9,11 +9,9 @@ use Illuminate\Database\Eloquent\Collection;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Notification;
use App\Classes\FTN\Message;
use App\Models\{Address,Domain,System};
use App\Notifications\Echomails\AbsentNodes;
use App\Notifications\Emails\NodeMarkedDown as NodeMarkedDownEmail;
@@ -205,7 +203,7 @@ class AddressIdle implements ShouldQueue
->whereIn('addresses.id',our_nodes($do)->pluck('id'))
->when($ao,fn($query)=>$query->where('addresses.id',$ao->id))
->where(fn($q)=>$q->where('last_session','<',$age)
->orWhere(fn($q)=>$q->whereNull('last_session')->where('updated_at','<',Carbon::now()->subDays(14)->startOfDay())))
->orWhere(fn($q)=>$q->whereNull('last_session')->where('addresses.updated_at','<',Carbon::now()->subDays(14)->startOfDay())))
->whereRaw(sprintf('((role IS NULL) OR (role=0) OR ((role & %d) > 0))',$flags))
->whereRaw(sprintf('((role IS NULL) OR ((role & %d) = 0))',Address::NODE_KEEP))
->join('systems',['systems.id'=>'addresses.system_id'])