-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
License: MIT Signed-off-by: Hector Sanjuan <[email protected]>
There was a problem hiding this 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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 <[email protected]>
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was mode not used?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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