-
-
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
Support for listing only cached links in refs command #2446
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
de84da9
Support for listing only cached links in refs command
sivachandran affc15e
Added final period in usage instruction.
sivachandran eee9549
Now offline BlockService is used if listing only cached refs.
sivachandran 60bc015
Uses DAG node get result to determine link cached status
sivachandran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
here, i would do something like:
and then for makeOfflineDatastore, do something like we do in merkledag/test/util.go to create a dagservice with only a blockstore and an offline exchange.
Then, pass that
dserv
to the RefWriter instead ofn.DAG
That way we avoid having split conditionals further down the codepath.
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.
@whyrusleeping incorporated your suggestion.
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.
now that you have that, you don't need any of the
Cached
logic in the RefWriterThere 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.
or at least, you might need less of it. In this case since you want a full listing of all local refs, you would just use the
Cached
flag to determine whether or not to error out on adag.ErrNotFound
type error from the dagserviceGet
method.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.
@whyrusleeping I am not sure how can I do without the
Cached
logic. TheNodeGetter.Get
hangs when I use with BlockService with offline exchange and the ref is not cached locally. Looks like I've to change quite a lot if I want to make nodePromise(i.e. NodeGetter) to respond even if the ref is not locally available.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 wow. thank you for reminding me that I hadnt merged #2257 yet.
That PR will make all this much easier
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 see that the PR is still having pending comments. When do you think you can merge the PR #2257?