From 11ae9b4f43d7daf77a423c67609c629a235f4847 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 21 Aug 2023 09:16:42 -0700 Subject: [PATCH] allow skipping errors while creating snowball archive (#1868) --- api-putobject-snowball.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api-putobject-snowball.go b/api-putobject-snowball.go index 849471e33..983ed6744 100644 --- a/api-putobject-snowball.go +++ b/api-putobject-snowball.go @@ -48,6 +48,10 @@ type SnowballOptions struct { // Compression will typically reduce memory and network usage, // Compression can safely be enabled with MinIO hosts. Compress bool + + // SkipErrs if enabled will skip any errors while reading the + // object content while creating the snowball archive + SkipErrs bool } // SnowballObject contains information about a single object to be added to the snowball. @@ -184,10 +188,16 @@ objectLoop: n, err := io.Copy(t, obj.Content) if err != nil { closeObj() + if opts.SkipErrs { + continue + } return err } if n != obj.Size { closeObj() + if opts.SkipErrs { + continue + } return io.ErrUnexpectedEOF } closeObj()