@cryptotaxi247 / kubo / commits / 8a4c15dde

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

License: MIT Signed-off-by: Juan Batiz-Benet <juan@benet.ai>

Juan Batiz-Benet committed Jul 28, 2015 at 23:57 UTC 8a4c15dde29d08ce67882b284457274642cf760a
1 file changed +4 -1
ipnsfs/system.go
+4 -1
@@ -34,6 +34,8 @@ var ErrIsDirectory = errors.New("error: is a directory")
34
35 // Filesystem is the writeable fuse filesystem structure
36 type Filesystem struct {
37 + ctx context.Context
38 +
39 dserv dag.DAGService
40
41 nsys namesys.NameSystem
@@ -49,6 +51,7 @@ type Filesystem struct {
51 func NewFilesystem(ctx context.Context, ds dag.DAGService, nsys namesys.NameSystem, pins pin.Pinner, keys ...ci.PrivKey) (*Filesystem, error) {
52 roots := make(map[string]*KeyRoot)
53 fs := &Filesystem{
54 + ctx: ctx,
55 roots: roots,
56 nsys: nsys,
57 dserv: ds,
@@ -77,7 +80,7 @@ func (fs *Filesystem) Close() error {
80 wg.Add(1)
81 go func(r *KeyRoot) {
82 defer wg.Done()
80 - err := r.Publish(context.TODO())
83 + err := r.Publish(fs.ctx)
84 if err != nil {
85 log.Info(err)
86 return