Don't log database connection for list of databases

This commit is contained in:
Cédric Krier committed 2008-10-29 16:22:01 +01:00
1 parent 816cd911db
commit fd849abbf6
2 files changed
+5 -4

No files matched your search

+4 -3
View File
@@ -82,14 +82,15 @@ def close_db(db_name):
finally:
_LOCK.release()
def get_db_only(db_name):
def get_db_only(db_name, verbose=True):
_LOCK.acquire()
try:
if db_name in _DB:
database = _DB[db_name]
else:
logging.getLogger('pooler').info(
'Connecting to %s' % (db_name))
if verbose:
logging.getLogger('pooler').info(
'Connecting to %s' % (db_name))
database = db_connect(db_name)
_DB[db_name] = database
finally:
+1 -1
View File
@@ -222,7 +222,7 @@ class DB(Service):
"ORDER BY datname")
res = []
for db_name, in cursor.fetchall():
cursor2 = pooler.get_db_only(db_name).cursor()
cursor2 = pooler.get_db_only(db_name, verbose=False).cursor()
if not cursor2.test():
cursor2.close()
pooler.close_db(db_name)