Permalink
Browse files

MB-100: cancel timeout when it is not necessary anymore

Change-Id: I9e794db1082dc61e463c9d760ba4f3b7570c4bce
Reviewed-on: http://review.couchbase.org/19766
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>
Tested-by: Pavel Paulau <pavel.paulau@gmail.com>
  • Loading branch information...
1 parent ae40afc commit a77f4d61b70ade7a543635cff8ac684ac1fa7290 @pavel-paulau pavel-paulau committed with pavel-paulau Aug 17, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 timeout.py
View
@@ -63,6 +63,9 @@ def handle_signal(signum, frame):
timer.start()
signal.signal(signal.SIGABRT, handle_signal)
- return function(*args, **kargs)
+ try:
+ return function(*args, **kargs)
+ finally:
+ timer.cancel()
return wrapper
return decorator

0 comments on commit a77f4d6

Please sign in to comment.