Skip to content

Commit

Permalink
Heartbeat - Use the date/time the information was stored in the datab…
Browse files Browse the repository at this point in the history
…ase instead of the date/time the event was generated.
  • Loading branch information
csavelief committed Aug 16, 2024
1 parent c599c77 commit 5313130
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Models/YnhServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ public function domain(): ?YnhDomain
public function lastHeartbeat(): ?Carbon
{
$minDate = Carbon::now()->subMinutes(30);
$heartbeat = YnhOsquery::select(['calendar_time'])
$heartbeat = YnhOsquery::select(['updated_at'])
->where('ynh_server_id', $this->id)
->where('calendar_time', '>=', $minDate->toDateTimeString())
->orderBy('calendar_time', 'desc')
->where('updated_at', '>=', $minDate->toDateTimeString())
->orderBy('updated_at', 'desc')
->first();
return $heartbeat?->calendar_time;
}
Expand Down

0 comments on commit 5313130

Please sign in to comment.