Fix lock wait timer

Summary:
The lock held timer was also including how long the lock had been waited on,
which was wrong. Let's break it into two timers.

Also fix an annoying indentation error.

Test Plan: Ran the tests

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.fb.com/D2474908
This commit is contained in:
Durham Goode 2015-09-23 19:32:34 -07:00
parent 7a1430d607
commit 9d22da7132

View File

@ -199,10 +199,13 @@ def executewithsql(repo, action, sqllock=False, *args, **kwargs):
connected = True
locked = False
startlock = time.time()
if sqllock and not writelock in repo.heldlocks:
repo.sqllock(writelock)
locked = True
startwait = time.time()
repo.sqllock(writelock)
locked = True
repo.ui.log("sqllock", "waited for sql lock for %s seconds\n",
time.time() - startwait)
startlock = time.time()
result = None
success = False