From 44f4856fd30e7544648ec9d955682fd9bd64fb62 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 8 May 2024 18:36:17 +0200 Subject: [server] DbImage: Add log messages --- .../main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java index 49dfaa9f..a6752f2d 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbImage.java @@ -627,11 +627,15 @@ public class DbImage { private static void writeChunks(MysqlConnection connection, String imageVersionId, ChunkList chunks) throws SQLException { - if (chunks == null || chunks.isEmpty()) + if (chunks == null || chunks.isEmpty()) { + LOGGER.info("Not writing chunk list - empty or missing"); return; + } for (FileChunk chunk : chunks.getAll()) { - if (chunk.getSha1Sum() == null) + if (chunk.getSha1Sum() == null) { + LOGGER.info("Not writing chunk list - at least one hash missing"); return; + } } MysqlStatement stmt = connection.prepareStatement("INSERT IGNORE INTO imageblock" + " (imageversionid, startbyte, blocksize, blocksha1, ismissing) VALUES" -- cgit v1.2.3-55-g7522