mò &U²Ic@s9dklZdkZddZdZdZd„ZdS((ssleepNf1.0i@f3.1415899999999999cOsÎt}|iddƒ}|idƒo |d=nx”y|||ŽSWq6ti j olt ot i d|ƒnt |ƒ|d9}|t jo t }n|d8}|djo‚qÅq6Xq6WdS(s?DeadlockWrap(function, *_args, **_kwargs) - automatically retries function in case of a database deadlock. This is a function intended to be used to wrap database calls such that they perform retrys with exponentially backing off sleeps in between when a DBLockDeadlockError exception is raised. A 'max_retries' parameter may optionally be passed to prevent it from retrying forever (in which case the exception will be reraised). d = DB(...) d.open(...) DeadlockWrap(d.put, "foo", data="bar") # set key "foo" to "bar" t max_retriesiÿÿÿÿis%dbutils.DeadlockWrap: sleeping %1.3f iN(t_deadlock_MinSleepTimet sleeptimet_kwargstgetRthas_keytfunctiont_argstdbtDBLockDeadlockErrort_deadlock_VerboseFiletwritet_sleept_deadlock_MaxSleepTime(RRRRR((t*/data/zmath/lib/python2.4/bsddb/dbutils.pyt DeadlockWrap)s&       ( ttimetsleepR RRR tNoneR R(RRR RR R ((Rt?s