��
���Lc@sqddklZddkZeiddjZeoddUn
ddkZddZdZdZ
d �ZdS(
i����(tsleepNiisfrom . import dbg�?i�gn���! @cOs�t}|idd�}d|jo|d=nx�to�y|||�SWq3tij
oltotid|�nt|�|d9}|tjo
t}n|d8}|djo�q�q3Xq3WdS(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"
tmax_retriesi����s%dbutils.DeadlockWrap: sleeping %1.3f
iiN( t_deadlock_MinSleepTimetgettTruetdbtDBLockDeadlockErrort_deadlock_VerboseFiletwritet_sleept_deadlock_MaxSleepTime(tfunctiont_argst_kwargst sleeptimeR((s#/usr/lib/python2.6/bsddb/dbutils.pytDeadlockWrap/s&
(ttimeRR tsystversion_infotabsolute_importRRR
tNoneRR(((s#/usr/lib/python2.6/bsddb/dbutils.pyt<module>s