From 27403a6e205f457715bb848fd8862c440ddbba78 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Thu, 26 Dec 2024 19:51:25 +0100 Subject: [PATCH] Backup : ignore error when a source file has been deleted during the backup precess --- .../java/fr/pandacube/lib/core/backup/ZipCompressor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandalib-core/src/main/java/fr/pandacube/lib/core/backup/ZipCompressor.java b/pandalib-core/src/main/java/fr/pandacube/lib/core/backup/ZipCompressor.java index 693ff3a..fc32288 100644 --- a/pandalib-core/src/main/java/fr/pandacube/lib/core/backup/ZipCompressor.java +++ b/pandalib-core/src/main/java/fr/pandacube/lib/core/backup/ZipCompressor.java @@ -5,6 +5,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.List; @@ -117,7 +118,11 @@ public class ZipCompressor { } for (Entry entry : entriesToCompress) { - entry.zip(); + try { + entry.zip(); + } catch (NoSuchFileException ignored) { + // file has been deleted since + } } synchronized (stateLock) {