On Mon, Oct 12, 2009 at 11:42 AM, Michael Hanselmann <[email protected]> wrote: > Guido Trotter wrote: >> >> On Fri, Oct 9, 2009 at 4:57 PM, Michael Hanselmann <[email protected]> >> wrote: >>> >>> +def _CalculateLockAttemptTimeouts(): >>> + """Calculate timeouts for lock attempts. >>> + >>> + """ >>> + running_sum = 0 >>> + result = [] >>> + >>> + # Wait for a total of at least 150s before doing a blocking acquire >>> + while running_sum < 150.0: >>> + try: >>> + prev_timeout = result[-1] >>> + except IndexError: >>> + prev_timeout = 0.5 >> >> Don't we use less lines doing result = [0.75] and skipping the try/except >> here? > > Did some more changes. Interdiff below. >
LGTM Thanks, Guido
