Close the database connection after operations in buildman

Also adds a *temporary* hack to prevent this from breaking tests
This commit is contained in:
Joseph Schorr 2017-07-26 12:10:48 -04:00
parent c271b1f386
commit 9febb539a7
3 changed files with 90 additions and 73 deletions

View file

@ -168,6 +168,7 @@ class CloseForLongOperation(object):
self.config_object = config_object
def __enter__(self):
# TODO(jschorr): Remove this stupid hack.
if self.config_object.get('TESTING') is True:
return
@ -185,9 +186,17 @@ class UseThenDisconnect(object):
self.config_object = config_object
def __enter__(self):
# TODO(jschorr): Remove this stupid hack.
if self.config_object.get('TESTING') is True:
return
configure(self.config_object)
def __exit__(self, typ, value, traceback):
# TODO(jschorr): Remove this stupid hack.
if self.config_object.get('TESTING') is True:
return
close_db_filter(None)