ipnsfs: remove context.TODO(), wire to FS context

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
This commit is contained in:
Juan Batiz-Benet 2015-07-28 23:57:51 -07:00
parent d4037f5f88
commit 8a4c15dde2

View File

@ -34,6 +34,8 @@ var ErrIsDirectory = errors.New("error: is a directory")
// Filesystem is the writeable fuse filesystem structure
type Filesystem struct {
ctx context.Context
dserv dag.DAGService
nsys namesys.NameSystem
@ -49,6 +51,7 @@ type Filesystem struct {
func NewFilesystem(ctx context.Context, ds dag.DAGService, nsys namesys.NameSystem, pins pin.Pinner, keys ...ci.PrivKey) (*Filesystem, error) {
roots := make(map[string]*KeyRoot)
fs := &Filesystem{
ctx: ctx,
roots: roots,
nsys: nsys,
dserv: ds,
@ -77,7 +80,7 @@ func (fs *Filesystem) Close() error {
wg.Add(1)
go func(r *KeyRoot) {
defer wg.Done()
err := r.Publish(context.TODO())
err := r.Publish(fs.ctx)
if err != nil {
log.Info(err)
return