diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 399: set the statement timeout to 30s on connection creation

Message ID 20120924025710.29712.83221.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson Sept. 24, 2012, 2:57 a.m. UTC
------------------------------------------------------------
revno: 399
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Mon 2012-09-24 14:55:36 +1200
message:
  set the statement timeout to 30s on connection creation
modified:
  lava_server/settings/debian.py


--
lp:lava-server
https://code.launchpad.net/~linaro-validation/lava-server/trunk

You are subscribed to branch lp:lava-server.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_server/settings/debian.py'
--- lava_server/settings/debian.py	2012-06-14 04:24:48 +0000
+++ lava_server/settings/debian.py	2012-09-24 02:55:36 +0000
@@ -89,3 +89,10 @@ 
 
 # Load extensions
 loader.contribute_to_settings(locals(), debian_settings)
+
+from django.db.backends.signals import connection_created
+
+def set_timeout(connection, **kw):
+    connection.cursor().execute("SET statement_timeout to 30000")
+
+connection_created.connect(set_timeout)