Turned off Connect() sqlaclehmy method. This seemd to be causing the db connection to timeout. From what I understand not opening the connection and leaving it open will allow the connection to establish itself the first time a query is called. Hopefully eliminating the timeout issue.
This commit is contained in:
2
main.py
2
main.py
@@ -27,7 +27,7 @@ class Book(Base):
|
|||||||
|
|
||||||
# Connect to database and establish a session
|
# Connect to database and establish a session
|
||||||
engine = create_engine('mysql+pymysql://library:jdSCAd6KEqfbpzh9NT4x@db.dandembinski.com:3306/Library')
|
engine = create_engine('mysql+pymysql://library:jdSCAd6KEqfbpzh9NT4x@db.dandembinski.com:3306/Library')
|
||||||
engine.connect()
|
# engine.connect()
|
||||||
|
|
||||||
Session = sessionmaker(bind=engine)
|
Session = sessionmaker(bind=engine)
|
||||||
session = Session()
|
session = Session()
|
||||||
|
|||||||
Reference in New Issue
Block a user