Skip to content

Commit

Permalink
Merge pull request #1985 from ipfs/rht-add-no-sync
Browse files Browse the repository at this point in the history
Add config option for flatfs no-sync
  • Loading branch information
whyrusleeping committed Nov 20, 2015
2 parents 856e250 + cab5868 commit b4ab684
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions repo/config/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Datastore struct {
GCPeriod string // in ns, us, ms, s, m, h

Params *json.RawMessage
NoSync bool
}

func (d *Datastore) ParamData() []byte {
Expand Down
3 changes: 2 additions & 1 deletion repo/fsrepo/defaultds.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ func openDefaultDatastore(r *FSRepo) (repo.Datastore, error) {
// including "/" from datastore.Key and 2 bytes from multihash. To
// reach a uniform 256-way split, we need approximately 4 bytes of
// prefix.
blocksDS, err := flatfs.New(path.Join(r.path, flatfsDirectory), 4)
syncfs := !r.config.Datastore.NoSync
blocksDS, err := flatfs.New(path.Join(r.path, flatfsDirectory), 4, syncfs)
if err != nil {
return nil, fmt.Errorf("unable to open flatfs datastore: %v", err)
}
Expand Down

0 comments on commit b4ab684

Please sign in to comment.