aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-08-10 16:49:38 +0000
committerRob Austein <sra@hactrn.net>2012-08-10 16:49:38 +0000
commitec1ea025ad1aa75ea565414dc946878b0d3c56e4 (patch)
tree1449ad82fa364fac415c24acd2521d6de3c3aba3
parent07d1098ee09b2743f11f2a66294f3288a6a5f2c2 (diff)
Add seemingly-pointless .cursor() call, whose real purpose is to run
the underlying MySQLdb.Connection.ping() method before we start a new operation. Not sure why this is necessary, I thought Django handled that sort of thing automatically, but ORM support for long-lived servers is a bit sketchy so maybe they missed this one. svn path=/branches/tk274/; revision=4627
-rw-r--r--rpkid/rpki/irdbd.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/rpkid/rpki/irdbd.py b/rpkid/rpki/irdbd.py
index 592ad799..908c3325 100644
--- a/rpkid/rpki/irdbd.py
+++ b/rpkid/rpki/irdbd.py
@@ -105,6 +105,8 @@ class main(object):
try:
q_pdu = None
r_msg = rpki.left_right.msg.reply()
+ from django.db import connection
+ connection.cursor() # Reconnect to mysqld if necessary
self.start_new_transaction()
serverCA = rpki.irdb.ServerCA.objects.get()
rpkid = serverCA.ee_certificates.get(purpose = "rpkid")