Skip to content

Commit

Permalink
meta/sql: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Dec 29, 2024
1 parent 53f57ac commit 2e734c9
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/meta/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,13 +859,8 @@ func (m *dbMeta) txn(f func(s *xorm.Session) error, inodes ...Ino) error {
func (m *dbMeta) roTxn(ctx context.Context, f func(s *xorm.Session) error) error {
start := time.Now()
defer func() { m.txDist.Observe(time.Since(start).Seconds()) }()
var s *xorm.Session
if v := ctx.Value(txSessionKey{}); v != nil {
s = v.(*xorm.Session)
} else {
s = m.db.NewSession()
defer s.Close()
}
s := m.db.NewSession()
defer s.Close()
var opt sql.TxOptions
if !m.noReadOnlyTxn {
opt.ReadOnly = true
Expand Down

0 comments on commit 2e734c9

Please sign in to comment.