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();