Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up repo if miner init fail and use log #624

Merged
merged 3 commits into from
Nov 19, 2019

Conversation

deaswang
Copy link
Contributor

fix #146

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that. Few nits

"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"golang.org/x/xerrors"
"gopkg.in/urfave/cli.v2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports got a little mixed up.

if err := storageMinerInit(ctx, cctx, api, lr); err != nil {
log.Errorf("Failed to initialize lotus-storage-miner: %s", err)
log.Infof("Cleaning up %s after attempt...", lr.Path())
if err := lr.Close(); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep this Close in storageMinerInit, and do

path, err := homedir.Expand(repoPath)
if err != nil {
	return nil, err
}

Here instead

deaswang and others added 2 commits November 16, 2019 14:16
Co-Authored-By: Łukasz Magiera <magik6k@users.noreply.github.com>
@deaswang deaswang requested a review from magik6k November 16, 2019 06:49
@magik6k magik6k merged commit b6a8feb into filecoin-project:master Nov 19, 2019
@ridewindx ridewindx deleted the fix/146-cleanup-miner-repo branch January 11, 2020 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If lotus-storage-miner init fails, clean up repo
2 participants