Skip to content

Commit 5ae4fc4

Browse files
committed
fixes #11
1 parent 472ab11 commit 5ae4fc4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fastasyncpg/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,9 @@ async def claim_one(self:Table, status_col='status', pending='pending', complete
715715
tbl = txn.t[self.name]
716716
p.db = txn
717717
p.evt = await tbl.claim(where=f'"{status_col}"=$1', where_args=[pending], order_by=order_by)
718+
if p.evt is None: return
718719
try: yield p
719720
except Exception as e: p.failed, p.exc, p.tb = True, e, traceback.format_exc()
720-
if p.evt is None: return
721721
pk = self.pks[0]
722722
new = failed if p.failed else (None if p.retry else completed)
723723
stmt = f'UPDATE {self} SET "{status_col}"=$1 WHERE "{pk}"=$2'

nbs/00_core.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4991,9 +4991,9 @@
49914991
" tbl = txn.t[self.name]\n",
49924992
" p.db = txn\n",
49934993
" p.evt = await tbl.claim(where=f'\"{status_col}\"=$1', where_args=[pending], order_by=order_by)\n",
4994+
" if p.evt is None: return\n",
49944995
" try: yield p\n",
49954996
" except Exception as e: p.failed, p.exc, p.tb = True, e, traceback.format_exc()\n",
4996-
" if p.evt is None: return\n",
49974997
" pk = self.pks[0]\n",
49984998
" new = failed if p.failed else (None if p.retry else completed)\n",
49994999
" stmt = f'UPDATE {self} SET \"{status_col}\"=$1 WHERE \"{pk}\"=$2'\n",

0 commit comments

Comments
 (0)