Closed JBecquer closed 1 year ago
Will need to scrub for db.close() and move that command to our code exit conditions
Tabled for now because this would take a fair bit of reworking to the code and how mysql_connect() interacts with all of the various functions. Will monitor run times moving forward and evaluate as needed.
Every time we work on a new aircraft or push/pull data we are reconnecting to MySQL.
Instead we can update our mycursor.execute commands to reference the schema we want to manipulate, rather than re-connecting every time.
example: FROM mycursor.execute(f"SELECT date FROM fleet WHERE aircraft = \"{aircraft}\"") TO mycursor.execute(f"SELECT date FROM date_last_ran.fleet WHERE aircraft = \"{aircraft}\"")
and remove the database line of mysql_connect