close files opened during migration (#10956)
Some checks are pending
CodeQL / codeql (push) Waiting to run
Docker Check / lint (push) Waiting to run
Docker Check / build (push) Waiting to run
Gateway Conformance / gateway-conformance (push) Waiting to run
Gateway Conformance / gateway-conformance-libp2p-experiment (push) Waiting to run
Go Build / go-build (push) Waiting to run
Go Check / go-check (push) Waiting to run
Go Lint / go-lint (push) Waiting to run
Go Test / go-test (push) Waiting to run
Interop / interop-prep (push) Waiting to run
Interop / helia-interop (push) Blocked by required conditions
Interop / ipfs-webui (push) Blocked by required conditions
Sharness / sharness-test (push) Waiting to run
Spell Check / spellcheck (push) Waiting to run

This commit is contained in:
Andrew Gillis 2025-09-08 10:20:24 -07:00 committed by GitHub
parent 72280f31d4
commit 6faa9d85bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -83,10 +83,12 @@ func addMigrationFiles(ctx context.Context, node *core.IpfsNode, paths []string,
fi, err := f.Stat()
if err != nil {
f.Close()
return err
}
ipfsPath, err := ufs.Add(ctx, files.NewReaderStatFile(f, fi), options.Unixfs.Pin(pin, ""))
f.Close()
if err != nil {
return err
}

View File

@ -393,6 +393,7 @@ func (r *FSRepo) SetAPIAddr(addr ma.Multiaddr) error {
}
if _, err = f.WriteString(addr.String()); err != nil {
f.Close()
return err
}
if err = f.Close(); err != nil {