mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
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:
parent
7a1430d607
commit
9d22da7132
9
hgsql.py
9
hgsql.py
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user