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

Issue #3419: Do not recursively resolve DAG just to obtain a CID #3420

Merged
merged 2 commits into from
Nov 25, 2016

Conversation

hsanjuan
Copy link
Contributor

Resolve() tries to fetch the object to check if it has to recursively do something with children (I think). It's overkill here (I think). See #3419

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
@Kubuxu Kubuxu added the status/in-progress In progress label Nov 24, 2016
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

I think this LGTM 👍 , with a minor nitpick

@@ -269,6 +269,11 @@ type RefKeyList struct {

func pinLsKeys(args []string, typeStr string, ctx context.Context, n *core.IpfsNode) (map[string]RefKeyObject, error) {

mode, ok := pin.StringToPinMode(typeStr)
if !ok {
return nil, fmt.Errorf("Invalid pin mode '%s'", typeStr)
Copy link

Choose a reason for hiding this comment

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

Error message should be lower case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing out. Fixed

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
@ghost
Copy link

ghost commented Nov 24, 2016

LGTM

Note this will still hit the network for paths which aren't just plain /ipfs/hash (e.g. /ipns/hash or /ipfs/hash/foo) -- but that's fine and I feel like it's expected.

if err != nil {
return nil, err
}

mode, ok := pin.StringToPinMode(typeStr)
Copy link
Member

Choose a reason for hiding this comment

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

was mode not used?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, wait, i see. you just moved this code.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was moved to the beginning of the function, line 272

@whyrusleeping whyrusleeping merged commit 38d009d into master Nov 25, 2016
@whyrusleeping whyrusleeping deleted the fix/pin-ls branch November 25, 2016 06:49
@whyrusleeping whyrusleeping removed the status/in-progress In progress label Nov 25, 2016
@ghost ghost mentioned this pull request Dec 23, 2016
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.

4 participants