From 7d93738d46d32ed1966fa2cd42ce953e4a0c581b Mon Sep 17 00:00:00 2001 From: Adam Balan Date: Wed, 21 Aug 2024 13:36:50 -0600 Subject: [PATCH] Minor fix --- app/Console/Commands/CheckInactiveSessions.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/app/Console/Commands/CheckInactiveSessions.php b/app/Console/Commands/CheckInactiveSessions.php index c9e962b84..bcdfef52c 100644 --- a/app/Console/Commands/CheckInactiveSessions.php +++ b/app/Console/Commands/CheckInactiveSessions.php @@ -37,18 +37,6 @@ public function handle() { $loggedInAt = Carbon::parse($login->logged_in_at); $lastHeartbeat = Carbon::parse($login->last_heart_beat); // Correct column name - $login->logged_out_at = Carbon::now(); - $login->duration_in_seconds = $lastHeartbeat->diffInSeconds($loggedInAt); - $login->save(); - });$threshold = now()->subHour(); - - UserLoginDuration::whereNull('logged_out_at') - ->where('last_heartbeat_at', '<', $threshold) - ->get() - ->each(function ($login) { - $loggedInAt = Carbon::parse($login->logged_in_at); - $lastHeartbeat = Carbon::parse($login->last_heartbeat_at); - $login->logged_out_at = Carbon::now(); $login->duration_in_seconds = $lastHeartbeat->diffInSeconds($loggedInAt); $login->save();