mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
Make rollback conditional on db.dirty
avoids calling rollback when there are no changes includes warning about what objects are actually dirty
This commit is contained in:
@@ -94,7 +94,9 @@ class BaseHandler(RequestHandler):
|
||||
|
||||
def finish(self, *args, **kwargs):
|
||||
"""Roll back any uncommitted transactions from the handler."""
|
||||
self.db.rollback()
|
||||
if self.db.dirty:
|
||||
self.log.warning("Rolling back dirty objects %s", self.db.dirty)
|
||||
self.db.rollback()
|
||||
super().finish(*args, **kwargs)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user