Skip to content

Commit

Permalink
limits db connections getting caught 'idle in transaction' which prev…
Browse files Browse the repository at this point in the history
…ents them from getting recycled
  • Loading branch information
btylerburton committed Nov 7, 2024
1 parent c842d24 commit e7ed785
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions database/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@ def __init__(self, session=None):
if session is None:
engine = create_engine(
DATABASE_URI,
isolation_level="AUTOCOMMIT",
pool_size=10,
max_overflow=20,
pool_timeout=60,
pool_recycle=1800,
)
session_factory = sessionmaker(
bind=engine, autocommit=False, autoflush=False
)
session_factory = sessionmaker(bind=engine, autoflush=True)
self.db = scoped_session(session_factory)
else:
self.db = session
Expand Down

1 comment on commit e7ed785

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests Skipped Failures Errors Time
2 0 💤 0 ❌ 0 🔥 5.773s ⏱️

Please sign in to comment.