Force session flush within try/catch, for batch refresh

This commit is contained in:
Lance Edgar 2022-03-26 15:29:28 -05:00
parent 1bad1cd3e7
commit b4d5d70e4c

View file

@ -1114,6 +1114,7 @@ class BatchMasterView(MasterView):
cognizer = session.query(model.User).get(user_uuid) if user_uuid else None cognizer = session.query(model.User).get(user_uuid) if user_uuid else None
try: try:
self.refresh_data(session, batch, cognizer, progress=progress) self.refresh_data(session, batch, cognizer, progress=progress)
session.flush()
except Exception as error: except Exception as error:
session.rollback() session.rollback()
log.warning("refreshing data for batch failed: {}".format(batch), exc_info=True) log.warning("refreshing data for batch failed: {}".format(batch), exc_info=True)