Skip to content

Commit 60d1c55

Browse files
authored
Merge pull request #35 from filecoin-project/fix/no-latest-on-export-failure
fix: do not update latest when export fails
2 parents 777ccb5 + 0075ada commit 60d1c55

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

cmd/filecoin-chain-archiver/cmds/create.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ var cmdCreate = &cli.Command{
323323
if flagDiscard {
324324
logger.Infow("discarding output")
325325
io.Copy(ioutil.Discard, r)
326+
327+
if err := <-errCh; err != nil {
328+
return err
329+
}
326330
} else {
327331
host := u.Hostname()
328332
port := u.Port()
@@ -365,6 +369,10 @@ var cmdCreate = &cli.Command{
365369
"expiration_rule_id", info.ExpirationRuleID,
366370
)
367371

372+
if err := <-errCh; err != nil {
373+
return err
374+
}
375+
368376
latestLocation, err := url.QueryUnescape(info.Location)
369377
if err != nil {
370378
logger.Errorw("failed to decode location url", "location", info.Location, "err", err)
@@ -401,10 +409,6 @@ var cmdCreate = &cli.Command{
401409
)
402410
}
403411

404-
if err := <-errCh; err != nil {
405-
return err
406-
}
407-
408412
logger.Infow("finished", "digiest", fmt.Sprintf("%x", h.Sum(nil)))
409413

410414
return nil

0 commit comments

Comments
 (0)