From ac7ae13dac1eae68f76fe3629f6034b41ca231c7 Mon Sep 17 00:00:00 2001 From: tonio Date: Fri, 18 Jun 2010 17:34:53 +0200 Subject: [PATCH] Temp. fix for ticket #71 --- INSTALL | 5 ++--- lib/db.py | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/INSTALL b/INSTALL index c13d19466..8b3368ae5 100644 --- a/INSTALL +++ b/INSTALL @@ -438,8 +438,7 @@ add the following line inside root's crontab:: Replace mailng_dir with the installation path of MailNG. By default, messages older than 14 days are automatically purged. You -can modify this value by changing the variable MAX_MESSAGES_AGE inside -settings.py. +can modify this value by changing the MAX_MESSAGES_AGE parameter in the admin panel. Using the statistics plugin --------------------------- @@ -526,4 +525,4 @@ Last but not least, modify the SECRET_KEY parameter and choose a new value (exactly 16 characters). This key is really important, it is used to encrypt/decrypt user passwords stored inside sessions. -Do not communicate this key to anyone!! \ No newline at end of file +Do not communicate this key to anyone!! diff --git a/lib/db.py b/lib/db.py index 9e064bc58..a926148d0 100644 --- a/lib/db.py +++ b/lib/db.py @@ -13,13 +13,18 @@ def mysql_newconnection(host, dbname, login, password): return MySQLdb.connect(host=host, db=dbname, user=login, passwd=password) def getconnection(name): - if not name in connections.keys(): +# if not name in connections.keys(): + if True: from django.conf import settings cfg = settings.DB_CONNECTIONS[name] if cfg["driver"] == "mysql": conn = mysql_newconnection(cfg["host"], cfg["dbname"], cfg["login"], cfg["password"]) + + if connections.has_key(name): + close(connections[name]) + connections[name] = conn return connections[name]