Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Jul 11, 2024
1 parent 0de1012 commit a626272
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/storage/fs/posix/tree/assimilation.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (t *Tree) Scan(path string, action EventAction, isDir bool, recurse bool) e
})

case ActionDelete:
t.HandleFileDelete(path)
_ = t.HandleFileDelete(path)
}

return nil
Expand Down Expand Up @@ -328,14 +328,14 @@ func (t *Tree) assimilate(item scanItem) error {
// check for the id attribute again after grabbing the lock, maybe the file was assimilated/created by us in the meantime
id, err = t.lookup.MetadataBackend().Get(context.Background(), item.Path, prefixes.IDAttr)
if err == nil {
previousPath, ok := t.lookup.(*lookup.Lookup).GetCachedID(context.Background(), string(spaceID), string(id))
previousPath, ok := t.lookup.(*lookup.Lookup).GetCachedID(context.Background(), spaceID, string(id))

// This item had already been assimilated in the past. Update the path
_ = t.lookup.(*lookup.Lookup).CacheID(context.Background(), string(spaceID), string(id), item.Path)
_ = t.lookup.(*lookup.Lookup).CacheID(context.Background(), spaceID, string(id), item.Path)

previousParentID, _ := t.lookup.MetadataBackend().Get(context.Background(), item.Path, prefixes.ParentidAttr)

fi, err := t.updateFile(item.Path, string(id), string(spaceID))
fi, err := t.updateFile(item.Path, string(id), spaceID)
if err != nil {
return err
}
Expand All @@ -356,15 +356,15 @@ func (t *Tree) assimilate(item scanItem) error {
ref := &provider.Reference{
ResourceId: &provider.ResourceId{
StorageId: t.options.MountID,
SpaceId: string(spaceID),
SpaceId: spaceID,
OpaqueId: string(parentID),
},
Path: filepath.Base(item.Path),
}
oldRef := &provider.Reference{
ResourceId: &provider.ResourceId{
StorageId: t.options.MountID,
SpaceId: string(spaceID),
SpaceId: spaceID,
OpaqueId: string(previousParentID),
},
Path: filepath.Base(previousPath),
Expand All @@ -383,15 +383,15 @@ func (t *Tree) assimilate(item scanItem) error {
} else {
// assimilate new file
newId := uuid.New().String()
fi, err := t.updateFile(item.Path, newId, string(spaceID))
fi, err := t.updateFile(item.Path, newId, spaceID)
if err != nil {
return err
}

ref := &provider.Reference{
ResourceId: &provider.ResourceId{
StorageId: t.options.MountID,
SpaceId: string(spaceID),
SpaceId: spaceID,
OpaqueId: newId,
},
}
Expand Down

0 comments on commit a626272

Please sign in to comment.