summaryrefslogtreecommitdiffstats
path: root/tupkg/update/tupkgupdate
diff options
context:
space:
mode:
authorsimo <simo>2005-12-18 05:10:04 +0000
committersimo <simo>2005-12-18 05:10:04 +0000
commitadcf3cecd0071544a855dc72295f0f3fc9aab3cd (patch)
tree4cd027a6dbc216ab1ae5cf2b49634e9d7560ad0b /tupkg/update/tupkgupdate
parent2d59d0d873d381a35353fc45a21388fdcfb43c03 (diff)
downloadaurweb-adcf3cecd0071544a855dc72295f0f3fc9aab3cd.tar.xz
fixed persistent mysql connections in tupkgupdate
Diffstat (limited to 'tupkg/update/tupkgupdate')
-rwxr-xr-xtupkg/update/tupkgupdate6
1 files changed, 5 insertions, 1 deletions
diff --git a/tupkg/update/tupkgupdate b/tupkg/update/tupkgupdate
index 5c20abf..f300024 100755
--- a/tupkg/update/tupkgupdate
+++ b/tupkg/update/tupkgupdate
@@ -45,7 +45,11 @@ class PackageDatabase:
self.dbname = dbname
self.connection = MySQLdb.connect(host=host, user=user, passwd=password, db=dbname)
def cursor(self):
- return self.connection.cursor()
+ try:
+ self.connection.ping()
+ except MySQLdb.OperationalError:
+ self.connection = MySQLdb.connect(host=self.host, user=self.user, passwd=self.password, db=self.dbname)
+ return self.connection.cursor()
def lookup(self, packagename):
warning("DB: Looking up package: " + packagename)
q = self.cursor()