From d596a9d790b9d720df9f7e0535da5fc7f766a3ed Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Sat, 18 Feb 2023 23:47:52 +0100 Subject: [PATCH] Improve logging --- Sources/App/CapServer.swift | 9 +++++++++ Training/train.swift | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Sources/App/CapServer.swift b/Sources/App/CapServer.swift index 23e6307..14c261f 100644 --- a/Sources/App/CapServer.swift +++ b/Sources/App/CapServer.swift @@ -235,12 +235,20 @@ final class CapServer { log("Failed to get image urls for cap \(cap.id)") return } + + if images.count != cap.count { + log("\(images.count) instead of \(cap.count) images for cap \(cap.id)") + } + + // Get list of existing images var sorted: [(id: Int, url: URL)] = images.compactMap { guard let id = Int($0.deletingPathExtension().lastPathComponent.components(separatedBy: "-").last!) else { return nil } return (id, $0) }.sorted { $0.id < $1.id } + + // Check that all images are available for version in 0..