set poll switch lock timeout to 120 seconds

Change-Id: I045dbd3a6593d0523ddbb0fd335949faaffdf028
This commit is contained in:
xiaodongwang 2014-09-07 11:19:48 -07:00
parent ab0aef1c3e
commit 5263865e31
2 changed files with 4 additions and 1 deletions

3
.gitignore vendored
View File

@ -6,6 +6,9 @@
# C extensions
*.so
# log extensions
*.log
# Packages
*.egg
*.egg-info

View File

@ -120,7 +120,7 @@ def poll_switch(
"""
poller = user_api.get_user_object(poller_email)
ip_int = long(netaddr.IPAddress(ip_addr))
with util.lock('poll switch %s' % ip_addr) as lock:
with util.lock('poll switch %s' % ip_addr, timeout=120) as lock:
if not lock:
raise Exception(
'failed to acquire lock to poll switch %s' % ip_addr