Rework address roles, making Address::role optional, rework determining uplink/downlinks/parent/children
This commit is contained in:
@@ -44,7 +44,7 @@ class SystemHeartbeat #implements ShouldQueue
|
||||
->whereNotNull('pollmode')
|
||||
->where(function($query) {
|
||||
return $query
|
||||
->where('role','<',Address::NODE_ACTIVE)
|
||||
->where('role','<',Address::NODE_NN)
|
||||
->orWhereNotNull('heartbeat');
|
||||
})
|
||||
->when(! $this->force,function($query) {
|
||||
@@ -62,7 +62,7 @@ class SystemHeartbeat #implements ShouldQueue
|
||||
if (Job::where('queue','poll')->get()->pluck('command.address.id')->search($oo->id) === FALSE) {
|
||||
if ((! $oo->system->last_session)
|
||||
|| ($oo->system->hearbeat && ($oo->system->last_session->addHours($oo->system->heartbeat) < Carbon::now()))
|
||||
|| ((! $oo->system->hearbeat) && ($oo->role < Address::NODE_ACTIVE) && ($oo->system->last_session->addHours(6) < Carbon::now())))
|
||||
|| ((! $oo->system->hearbeat) && ($oo->role_id < Address::NODE_NN) && ($oo->system->last_session->addHours(6) < Carbon::now())))
|
||||
{
|
||||
Log::info(sprintf('%s:- Polling [%s] (%s) - we havent seen them since [%s], heartbeat [%d]',
|
||||
self::LOGKEY,
|
||||
|
Reference in New Issue
Block a user