diff options
| author | Christophe Simonis <christophe@cobalt> | 2008-12-15 16:36:16 +0100 |
|---|---|---|
| committer | Christophe Simonis <christophe@cobalt> | 2008-12-15 16:36:16 +0100 |
| commit | be2a0a76bbd95ce83cc68a10ce25e5b60279a0e6 (patch) | |
| tree | 41fd5a835d11a1a5d758400541cb551bd29f2e2a | |
| parent | 85c8b304bfbaa715c92b878c0e51d8924f012db9 (diff) | |
[FIX] the database connectin pool generate at least one connection to ensure earliest that the database is reachable
bzr revid: christophe@cobalt-20081215153616-dyb7xj771tzj5de1
| -rw-r--r-- | bin/sql_db.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/sql_db.py b/bin/sql_db.py index 03828a1ee87..3f4e23cc392 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -213,9 +213,9 @@ class PoolManager(object): logger = netsvc.Logger() try: logger.notifyChannel('dbpool', netsvc.LOG_INFO, 'Connecting to %s' % (db_name,)) - PoolManager._pools[db_name] = ConnectionPool(ThreadedConnectionPool(0, PoolManager.maxconn, PoolManager.dsn(db_name)), db_name) + PoolManager._pools[db_name] = ConnectionPool(ThreadedConnectionPool(1, PoolManager.maxconn, PoolManager.dsn(db_name)), db_name) except Exception, e: - logger.notifyChannel('dbpool', netsvc.LOG_CRITICAL, 'Unable to connect to %s: %r' % (db_name, e)) + logger.notifyChannel('dbpool', netsvc.LOG_CRITICAL, 'Unable to connect to %s: %s' % (db_name, e.message)) raise return PoolManager._pools[db_name] get = staticmethod(get) |
