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

add option to disable syncing #32

Merged
merged 1 commit into from
Nov 10, 2015

Conversation

whyrusleeping
Copy link
Member

gives flatfs a way to be less safe, but wayyyyy faster.

jbenet added a commit that referenced this pull request Nov 10, 2015
@jbenet jbenet merged commit 38b98ce into ipfs:master Nov 10, 2015
@rht
Copy link
Contributor

rht commented Nov 13, 2015

As with the interface, I thought the default New constructor syncs by default? ref: #30 (comment)

@rht rht mentioned this pull request Nov 13, 2015
@jbenet
Copy link
Member

jbenet commented Nov 16, 2015

i'd vote for syncing by default-- but i guess this at least breaks the code and forces users to look at the new interface.

if we want to not break code, i'd suggest:

func New(path string, prefixLen int) (*Datastore, error)
func NewSync(path string, prefixLen int, sync bool) (*Datastore, error)

@rht
Copy link
Contributor

rht commented Nov 17, 2015

As with compatibility breaking, the project that vendors and uses go-datastore directly so far is go-ipfs (that I can find from the internet). And so this can be quickly mended.

note: all the specific implementations of the Datastore interface has one version of New/NewDatastore/NewDs. Some of them use option struct (just as struct fields have default value, and hence the defaults can be set), which is more future-proof. But this is unnecessary unless there will be more options to flatfs.New in the future.

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.

3 participants