Skip to content

Refactors for Gateway Server - #642

Merged
btc merged 10 commits into
masterfrom
refactors/for-gw-server
Jan 24, 2015
Merged

btc merged 10 commits into
masterfrom
refactors/for-gw-server

Conversation

@btc

@btc btc commented Jan 24, 2015

Copy link
Copy Markdown
Contributor

This PR is comprised of preparatory refactors for an upcoming IPFS gateway-server binary.

  • improves corehttp interface
  • renames corerepo directory
  • adds an fsrepo.BestKnownPath() method to handle order of precedence between the default FSRepo path and the path provided using the IPFS_PATH env variable
  • provides blockstore.AllKeys(ctx) method and renames parameterized one to AllKeysRange(ctx, 0, 0)
  • renames corerepo.GarbageCollectAsync and adds a synchronous version
  • integrates eventlog into the fsrepo package so eventlogging works wherever fsrepo's are used
  • fixes a bug in the eventlog begin output

@jbenet @whyrusleeping

@btc btc added the status/in-progress In progress label Jan 24, 2015
Comment thread core/corerepo/gc.go

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

im worried that the implementation of GarbageCollect and GarbageCollectAsync may drift. thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The meat of the two operations is limited to 3 statements.

keychan, err := n.Blockstore.AllKeysChan(ctx)
if !n.Pinning.IsPinned(k) {
err := n.Blockstore.DeleteBlock(k)

The rest is boilerplate async. It seems that sharing more code would make the synchronous version more complex and the asynchronous one less direct.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sgtm

@jbenet

jbenet commented Jan 24, 2015

Copy link
Copy Markdown
Member

LGTM RTM

btc pushed a commit that referenced this pull request Jan 24, 2015
@btc
btc merged commit 316576a into master Jan 24, 2015
@btc btc removed the status/in-progress In progress label Jan 24, 2015
@btc
btc deleted the refactors/for-gw-server branch January 24, 2015 10:07
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 27, 2023
Refactors for Gateway Server

This commit was moved from ipfs/kubo@316576a
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.

2 participants