Bump reva
This commit is contained in:
committed by
Ralf Haferkamp
parent
99aba9cfa1
commit
ae3582afa3
+1
-1
@@ -84,7 +84,7 @@ type Lookup struct {
|
||||
// New returns a new Lookup instance
|
||||
func New(b metadata.Backend, um usermapper.Mapper, o *options.Options, tm node.TimeManager) *Lookup {
|
||||
idHistoryConf := o.Options.IDCache
|
||||
idHistoryConf.Database = o.Options.IDCache.Table + "_history"
|
||||
idHistoryConf.Table = o.Options.IDCache.Table + "_history"
|
||||
idHistoryConf.TTL = 1 * time.Minute
|
||||
|
||||
spaceRootCache, _ := lru.New[string, string](1000)
|
||||
|
||||
+9
-15
@@ -381,6 +381,15 @@ func (t *Tree) Move(ctx context.Context, oldNode *node.Node, newNode *node.Node)
|
||||
newNode.ID = oldNode.ID
|
||||
}
|
||||
|
||||
// rename node
|
||||
err = os.Rename(
|
||||
filepath.Join(oldParent, oldNode.Name),
|
||||
filepath.Join(newParent, newNode.Name),
|
||||
)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "posixfs: could not move child")
|
||||
}
|
||||
|
||||
// update the id cache
|
||||
// invalidate old tree
|
||||
err = t.lookup.IDCache.DeleteByPath(ctx, filepath.Join(oldNode.ParentPath(), oldNode.Name))
|
||||
@@ -391,21 +400,6 @@ func (t *Tree) Move(ctx context.Context, oldNode *node.Node, newNode *node.Node)
|
||||
t.log.Error().Err(err).Str("spaceID", newNode.SpaceID).Str("id", newNode.ID).Str("path", filepath.Join(newNode.ParentPath(), newNode.Name)).Msg("could not cache id")
|
||||
}
|
||||
|
||||
// rename node
|
||||
err = os.Rename(
|
||||
filepath.Join(oldParent, oldNode.Name),
|
||||
filepath.Join(newParent, newNode.Name),
|
||||
)
|
||||
if err != nil {
|
||||
if err := t.lookup.CacheID(ctx, oldNode.SpaceID, oldNode.ID, filepath.Join(oldNode.ParentPath(), oldNode.Name)); err != nil {
|
||||
t.log.Error().Err(err).Str("spaceID", oldNode.SpaceID).Str("id", oldNode.ID).Str("path", filepath.Join(oldNode.ParentPath(), oldNode.Name)).Msg("could not reset cached id after failed move")
|
||||
}
|
||||
if err := t.WarmupIDCache(filepath.Join(oldNode.ParentPath(), oldNode.Name), false, false); err != nil {
|
||||
t.log.Error().Err(err).Str("spaceID", oldNode.SpaceID).Str("id", oldNode.ID).Str("path", filepath.Join(oldNode.ParentPath(), oldNode.Name)).Msg("could not warum cached after failed move")
|
||||
}
|
||||
return errors.Wrap(err, "posixfs: could not move child")
|
||||
}
|
||||
|
||||
// update target parentid and name
|
||||
attribs := node.Attributes{}
|
||||
attribs.SetString(prefixes.ParentidAttr, newNode.ParentID)
|
||||
|
||||
Reference in New Issue
Block a user