My code is :
from threading import Thread
class SQLThread(Thread):
def __init__(self, id):
print('
SQLThread
')
Thread.__init__(self)
self.id = id
self._fullname = None
def run(self):
try:
print('run')
connection = MySQLdb.connect(MYSQL_SERVER, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB, connect_timeout=2)
cursor = connection.cursor()
self._fullname = get_user_fullname(cursor,
self.id)
connection.close()
except MySQLdb.Error as e:
print('SQLThread: %s' % e)
Sorry, i thought the threads never run because 'run' is not written in the apache log file whereas '
SQLThread' is written. Do you know why ?