diff options
-rwxr-xr-x | tupkg/server/tupkgs | 2 | ||||
-rwxr-xr-x | tupkg/update/tupkgupdate | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tupkg/server/tupkgs b/tupkg/server/tupkgs index 2d7205bc..3b2c5100 100755 --- a/tupkg/server/tupkgs +++ b/tupkg/server/tupkgs @@ -132,7 +132,7 @@ class ClientSocket(threading.Thread): MySQLdb.escape_string(encpw)+ "'") dbconn.close() - except MySQLdb.OperationalError: + except : self.sendMsg("result=SQLERR") return 0 if q.rowcount == 0: diff --git a/tupkg/update/tupkgupdate b/tupkg/update/tupkgupdate index 5c20abfa..f300024c 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() |