Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure connection is closed after CLI commands #2635

Merged
merged 3 commits into from
Oct 27, 2023

Conversation

seallard
Copy link
Contributor

@seallard seallard commented Oct 27, 2023

Description

This PR adds a teardown function to the CLI which runs after each command has been processed, closing the database session and releasing any resources to the database. This might potentially resolve some of the issues we have experienced with alembic.

Fixed

  • Release db resources once CLI command has been processed

This version is a

  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

@seallard seallard requested a review from a team as a code owner October 27, 2023 07:17
@seallard seallard changed the title Ensure connection is closed Ensure connection is closed after CLI commands Oct 27, 2023
Copy link
Contributor

@diitaz93 diitaz93 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@henrikstranneheim henrikstranneheim left a comment

Choose a reason for hiding this comment

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

Awesome 👍

cg/cli/base.py Outdated Show resolved Hide resolved
@seallard
Copy link
Contributor Author

Deployed and tested in stage

@seallard seallard merged commit 3943157 into master Oct 27, 2023
@seallard seallard deleted the close-connections-in-cli branch October 27, 2023 09:14
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants