Skip to content

Commit

Permalink
Refactor MySQLConnection to handle closed connections during query ex…
Browse files Browse the repository at this point in the history
…ecution
  • Loading branch information
josephmancuso committed Oct 27, 2024
1 parent 09d082b commit e466282
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/masoniteorm/connections/MySQLConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def make_connection(self):

# Check if there is an available connection in the pool
self._connection = self.create_connection()
self._connection.close = self.close_connection
self.enable_disable_foreign_keys()

self.open = 1
Expand Down Expand Up @@ -115,6 +114,8 @@ def create_connection(self, autocommit=True):
database=self.database,
**self.options
)

connection.close = self.close_connection

return connection

Expand Down

0 comments on commit e466282

Please sign in to comment.