summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPami Ketolainen <pami.ketolainen@jollamobile.com>2014-01-03 18:33:43 +0200
committerPami Ketolainen <pami.ketolainen@gmail.com>2014-03-17 17:48:12 +0200
commit0d7addd505f1f3a3c02c9fdc6844183c4dca4445 (patch)
treee657b011e33c515265d8347492d60481b12cd2ca
parent0821a96efea80729aaa871fe4e0d3710fbea0a95 (diff)
downloadaskbot-0d7addd505f1f3a3c02c9fdc6844183c4dca4445.tar.gz
askbot-0d7addd505f1f3a3c02c9fdc6844183c4dca4445.tar.bz2
askbot-0d7addd505f1f3a3c02c9fdc6844183c4dca4445.zip
Fix database connection issues in prefork mode.
When running in prefork mode, open DB connection got shared between the child process as DB was accessed very early in the init process. One child would then close the connection and cause others to fail. To fix this, connection.close() was added to the end of startup procedures.
-rw-r--r--askbot/startup_procedures.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index 3adbd781..02fda329 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -1062,3 +1062,5 @@ def run():
except AskbotConfigError, error:
print error
sys.exit(1)
+ # close DB connection to prevent issues in prefork mode
+ connection.close()