X-Git-Url: http://dolda2000.com/gitweb/?p=didex.git;a=blobdiff_plain;f=didex%2Fdb.py;h=33eb0d8c7198b4b0a076a8b920fb58f14e4d523f;hp=7435166cde372f7deff7d44b43b4d4d95d7bdb33;hb=d6d41a45b2882bf919cd7702d7590ead03e9d590;hpb=cbf73d3a70b97f17f1f5431eee1e73dbc56a7f8e diff --git a/didex/db.py b/didex/db.py index 7435166..33eb0d8 100644 --- a/didex/db.py +++ b/didex/db.py @@ -94,6 +94,15 @@ class txn(object): def postcommit(self, fun): self.pcommit.add(fun) +def dloopfun(fun): + def wrapper(self, *args, **kwargs): + while True: + try: + return fun(self, *args, **kwargs) + except deadlock: + continue + return wrapper + def txnfun(envfun): def fxf(fun): def wrapper(self, *args, tx=None, **kwargs):