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

feat(datastore): expose datastore Close() #111

Merged
merged 1 commit into from
Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions autobatch/autobatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ func (d *Datastore) Query(q dsq.Query) (dsq.Results, error) {
func (d *Datastore) DiskUsage() (uint64, error) {
return ds.DiskUsage(d.child)
}

func (d *Datastore) Close() error {
magik6k marked this conversation as resolved.
Show resolved Hide resolved
return d.child.Close()
}
2 changes: 2 additions & 0 deletions datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package datastore

import (
"errors"
"io"
"time"

query "github.com/ipfs/go-datastore/query"
Expand Down Expand Up @@ -33,6 +34,7 @@ should be checked by callers.
type Datastore interface {
Read
Write
io.Closer
}

// Write is the write-side of the Datastore interface.
Expand Down
5 changes: 5 additions & 0 deletions failstore/failstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ func (d *Failstore) DiskUsage() (uint64, error) {
return ds.DiskUsage(d.child)
}

// Close implements the Datastore interface
func (d *Failstore) Close() error {
return d.child.Close()
}

// FailBatch implements batching operations on the Failstore.
type FailBatch struct {
cb ds.Batch
Expand Down