Skip to content
Merged
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
10 changes: 8 additions & 2 deletions internal/pss/vfs_workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ func (v *vfsReadFile) execute(ctx context.Context, p *pss, timeout time.Duration
commandCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()

file, err := p.vfs.Root(vent.VMRead).OpenAt(commandCtx, v.filePath)
root := p.vfs.Root(vent.VMRead)
Comment thread
iamandrii marked this conversation as resolved.

file, err := root.OpenAt(commandCtx, v.filePath)
if err != nil {
_ = root.CloseCtx(commandCtx)
return err
}
p.logger.Debug("file opened successfully", "path", v.filePath)
Expand Down Expand Up @@ -195,8 +198,11 @@ func (v *vfsAddFile) execute(ctx context.Context, p *pss, timeout time.Duration)
commandCtx, cancel := context.WithTimeout(ctx, timeout)
defer cancel()

dir, err := p.vfs.Root(vent.VMWrite).OpenAt(commandCtx, v.path)
root := p.vfs.Root(vent.VMWrite)
Comment thread
iamandrii marked this conversation as resolved.

dir, err := root.OpenAt(commandCtx, v.path)
if err != nil {
_ = root.CloseCtx(commandCtx)
p.logger.Error("failed to open dir", "path", v.path, "err", err)
return err
}
Expand Down