Improvements to finding idle nodes, last_session actually only shows the last time the remote polled us
This commit is contained in:
@@ -60,15 +60,15 @@ class SystemHeartbeat #implements ShouldQueue
|
||||
// If we havent polled in heatbeat hours, poll system
|
||||
foreach ($l as $oo) {
|
||||
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_id < Address::NODE_NN) && ($oo->system->last_session->addHours(6) < Carbon::now())))
|
||||
if ((! $oo->system->last_seen)
|
||||
|| ($oo->system->hearbeat && ($oo->system->last_seen->addHours($oo->system->heartbeat) < Carbon::now()))
|
||||
|| ((! $oo->system->hearbeat) && ($oo->role_id < Address::NODE_NN) && ($oo->system->last_seen->addHours(6) < Carbon::now())))
|
||||
{
|
||||
Log::info(sprintf('%s:- Polling [%s] (%s) - we havent seen them since [%s], heartbeat [%d]',
|
||||
self::LOGKEY,
|
||||
$oo->ftn,
|
||||
$oo->system->name,
|
||||
$oo->system->last_session ?: 'Never',
|
||||
$oo->system->last_seen ?: 'Never',
|
||||
$oo->system->heartbeat,
|
||||
));
|
||||
|
||||
@@ -78,7 +78,7 @@ class SystemHeartbeat #implements ShouldQueue
|
||||
Log::debug(sprintf('%s:= Not scheduling poll to [%s], we saw them [%s], heartbeat [%d]',
|
||||
self::LOGKEY,
|
||||
$oo->ftn,
|
||||
$oo->system->last_session,
|
||||
$oo->system->last_seen,
|
||||
$oo->system->heartbeat
|
||||
));
|
||||
}
|
||||
|
Reference in New Issue
Block a user