Fix session cleanup on startup by using correct JSON field name

This commit is contained in:
Peter Steinberger 2025-07-28 13:52:56 +02:00
parent 414a2160e7
commit f856c49e1b

View file

@ -379,9 +379,9 @@ class ServerManager {
if let httpResponse = response as? HTTPURLResponse {
if httpResponse.statusCode == 200 {
// Try to parse the response
// Parse the server response
if let jsonData = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
let cleanedCount = jsonData["cleaned_count"] as? Int
let cleanedCount = jsonData["localCleaned"] as? Int
{
logger.info("Initial cleanup completed: cleaned \(cleanedCount) exited sessions")
} else {