Skip to content

Commit

Permalink
database: don't prune locks when we renew one
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-M authored and jzelinskie committed Feb 24, 2016
1 parent 2690800 commit d3d689a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions database/pgsql/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ func (pgSQL *pgSQL) Lock(name string, owner string, duration time.Duration, rene

defer observeQueryTime("Lock", "all", time.Now())

// Prune locks.
pgSQL.pruneLocks()

// Compute expiration.
until := time.Now().Add(duration)

Expand All @@ -49,6 +46,9 @@ func (pgSQL *pgSQL) Lock(name string, owner string, duration time.Duration, rene
// Updated successfully.
return true, until
}
} else {
// Prune locks.
pgSQL.pruneLocks()
}

// Lock.
Expand Down

0 comments on commit d3d689a

Please sign in to comment.