Fixed exception when restarting mysql connection
This commit is contained in:
parent
da16ab1b1b
commit
50ae546613
1 changed files with 5 additions and 1 deletions
|
@ -12,7 +12,11 @@ class Module(ModuleBase):
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
if self.db:
|
if self.db:
|
||||||
|
try:
|
||||||
self.db.close()
|
self.db.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
self.db = MySQLdb.connect(host = self.conf['host'], user = self.conf['user'], passwd = self.conf['passwd'], db = self.conf['db'], use_unicode = True, charset = 'utf8')
|
self.db = MySQLdb.connect(host = self.conf['host'], user = self.conf['user'], passwd = self.conf['passwd'], db = self.conf['db'], use_unicode = True, charset = 'utf8')
|
||||||
|
|
||||||
def cursor(self):
|
def cursor(self):
|
||||||
|
|
Reference in a new issue