Skip to content

Commit

Permalink
Do not leave cursor hanging if there was no task available
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopofar committed Apr 23, 2024
1 parent 5f0237f commit e9fe135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postgrestq/task_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ def get(self) -> Tuple[Optional[Dict[str, Any]], Optional[UUID]]:
)

row = cur.fetchone()
conn.commit()
if row is None:
return None, None
task_id, task = row
logger.info(f"Got task with id {task_id}")
conn.commit()
return task, task_id

def get_many(self, amount: int) -> List[
Expand Down

0 comments on commit e9fe135

Please sign in to comment.