From d3d689a26ae89a700ff6fcdc1c3fefea345d297d Mon Sep 17 00:00:00 2001 From: Quentin Machu Date: Sun, 24 Jan 2016 01:20:34 -0500 Subject: [PATCH] database: don't prune locks when we renew one --- database/pgsql/lock.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/database/pgsql/lock.go b/database/pgsql/lock.go index 82d1c75f..cbf34e1a 100644 --- a/database/pgsql/lock.go +++ b/database/pgsql/lock.go @@ -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) @@ -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.