Skip to content

Commit

Permalink
Merge pull request #108 from GSA/fix-db-connection
Browse files Browse the repository at this point in the history
AutoCommit db connections
  • Loading branch information
FuhuXia authored Nov 7, 2024
2 parents c842d24 + e7ed785 commit 4917d82
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

3 comments on commit 4917d82

@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 🔥 8.976s ⏱️

@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 🔥 7.588s ⏱️

@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.471s ⏱️

Please sign in to comment.