aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobert van Gent <[email protected]>2021-04-28 20:32:19 -0700
committerBjørn Erik Pedersen <[email protected]>2021-04-29 07:07:01 +0200
commitf523e9f0fd0e0b0ce75879532caa834742297d16 (patch)
tree5dd1b3dc3d1fda7f86e1c910fa71e4df2c15c4c5
parent63cd05ce5ae308c496b848f6b11bcb3fdbdf5cb2 (diff)
downloadhugo-f523e9f0fd0e0b0ce75879532caa834742297d16.tar.gz
hugo-f523e9f0fd0e0b0ce75879532caa834742297d16.zip
deploy: Don't treat a NotFound response for Delete as a fatal error.
-rw-r--r--deploy/deploy.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/deploy/deploy.go b/deploy/deploy.go
index c75461750..96fecdc07 100644
--- a/deploy/deploy.go
+++ b/deploy/deploy.go
@@ -45,6 +45,7 @@ import (
_ "gocloud.dev/blob/fileblob" // import
_ "gocloud.dev/blob/gcsblob" // import
_ "gocloud.dev/blob/s3blob" // import
+ "gocloud.dev/gcerrors"
)
// Deployer supports deploying the site to target cloud providers.
@@ -238,9 +239,13 @@ func (d *Deployer) Deploy(ctx context.Context) error {
go func(del string) {
jww.INFO.Printf("Deleting %s...\n", del)
if err := bucket.Delete(ctx, del); err != nil {
- errMu.Lock()
- defer errMu.Unlock()
- errs = append(errs, err)
+ if gcerrors.Code(err) == gcerrors.NotFound {
+ jww.WARN.Printf("Failed to delete %q because it wasn't found: %v", del, err)
+ } else {
+ errMu.Lock()
+ defer errMu.Unlock()
+ errs = append(errs, err)
+ }
}
<-sem
}(del)