Close the database connection after operations in buildman
Also adds a *temporary* hack to prevent this from breaking tests
This commit is contained in:
parent
c271b1f386
commit
9febb539a7
3 changed files with 90 additions and 73 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Reference in a new issue