Skip to content

Commit

Permalink
Fixed forced cursor instance as first conn
Browse files Browse the repository at this point in the history
When the first db cursor made would be a forced cursor (`cursor(force_new=True)`), it would also become the default cursor. This lead mostly to Search All not going past one volume.
  • Loading branch information
Casvt committed Jan 20, 2025
1 parent adef083 commit 2cae63b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/internals/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ def cursor( # type: ignore
if not hasattr(g, 'cursors'):
g.cursors = []

if not force_new and g.cursors:
if not g.cursors:
c = KapowarrCursor(self)
c.row_factory = Row
g.cursors.append(c)

if not force_new:
return g.cursors[0]
else:
c = KapowarrCursor(self)
Expand Down

0 comments on commit 2cae63b

Please sign in to comment.