Skip to content

Commit

Permalink
adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro committed Mar 28, 2023
1 parent 3afb9b2 commit 675499c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/meta/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ type dirStats struct {
}

type detachedNode struct {
Inode Ino `xorm:"pk notnull"`
Expire int64 `xorm:"notnull"`
Inode Ino `xorm:"pk notnull"`
Added int64 `xorm:"notnull"`
}

type dirQuota struct {
Expand Down Expand Up @@ -3997,7 +3997,7 @@ func (m *dbMeta) mkNodeWithAttr(ctx Context, s *xorm.Session, srcIno Ino, srcNod
}

if !attach {
return mustInsert(s, &detachedNode{Inode: *dstIno, Expire: time.Now().Unix()})
return mustInsert(s, &detachedNode{Inode: *dstIno, Added: time.Now().Unix()})
}
if attach {
// set edge
Expand All @@ -4010,7 +4010,7 @@ func (m *dbMeta) doFindDetachedNodes(t time.Time) []Ino {
var detachedNodes []Ino
if err := m.roTxn(func(s *xorm.Session) error {
var nodes []detachedNode
err := s.Where("expire < ?", t).Find(&nodes)
err := s.Where("added < ?", t).Find(&nodes)
if err != nil {
return err
}
Expand Down

0 comments on commit 675499c

Please sign in to comment.