remove session instead of close to release file.

This commit is contained in:
Tomas Groth 2017-04-25 21:18:03 +02:00
parent 3b46b8416d
commit e9e7285b8c

View File

@ -191,10 +191,10 @@ def upgrade_db(url, upgrade):
break break
except (SQLAlchemyError, DBAPIError): except (SQLAlchemyError, DBAPIError):
version_meta = Metadata.populate(key='version', value=int(upgrade.__version__)) version_meta = Metadata.populate(key='version', value=int(upgrade.__version__))
session.commit() session.remove()
upgrade_version = upgrade.__version__ upgrade_version = upgrade.__version__
version = int(version_meta.value) version = int(version_meta.value)
session.close() session.remove()
return version, upgrade_version return version, upgrade_version