Commit 7b5db6dd authored by Christian Schneider's avatar Christian Schneider
Browse files

Fixed issues with new python mysql drivers. A default value was changed in a...

Fixed issues with new python mysql drivers. A default value was changed in a new version. We set it now by default to the old True value
parent ba23e7ec
......@@ -6,7 +6,7 @@ import getpass
import inspect
import pickle
from sqlalchemy.exc import StatementError
from sqlalchemy.exc import StatementError, InvalidRequestError
from Monitor.main import Instruments, db
from copy import copy
......@@ -99,6 +99,9 @@ def update_db(instrument, update_fromWeb=False, pars=None):
except StatementError:
# Do nothing if database is not responding
return None
except InvalidRequestError:
db.session.rollback()
db.session.close()
else:
# No database mode
pass
......
......@@ -53,6 +53,7 @@ cryo_url = ("mysql+mysqlconnector://{username}:" +
databasename='Cryostats')
app.config['SQLALCHEMY_DATABASE_URI'] = devices_url
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_ENGINE_OPTIONS'] = {'connect_args': {'use_pure': True}}
app.config['SQLALCHEMY_BINDS'] = {
'cryostats': cryo_url,
'devices': devices_url
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment