mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fixed persistent mysql connections in tupkgupdate
This commit is contained in:
parent
2d59d0d873
commit
adcf3cecd0
2 changed files with 6 additions and 2 deletions
|
@ -132,7 +132,7 @@ class ClientSocket(threading.Thread):
|
||||||
MySQLdb.escape_string(encpw)+
|
MySQLdb.escape_string(encpw)+
|
||||||
"'")
|
"'")
|
||||||
dbconn.close()
|
dbconn.close()
|
||||||
except MySQLdb.OperationalError:
|
except :
|
||||||
self.sendMsg("result=SQLERR")
|
self.sendMsg("result=SQLERR")
|
||||||
return 0
|
return 0
|
||||||
if q.rowcount == 0:
|
if q.rowcount == 0:
|
||||||
|
|
|
@ -45,7 +45,11 @@ class PackageDatabase:
|
||||||
self.dbname = dbname
|
self.dbname = dbname
|
||||||
self.connection = MySQLdb.connect(host=host, user=user, passwd=password, db=dbname)
|
self.connection = MySQLdb.connect(host=host, user=user, passwd=password, db=dbname)
|
||||||
def cursor(self):
|
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):
|
def lookup(self, packagename):
|
||||||
warning("DB: Looking up package: " + packagename)
|
warning("DB: Looking up package: " + packagename)
|
||||||
q = self.cursor()
|
q = self.cursor()
|
||||||
|
|
Loading…
Add table
Reference in a new issue