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 ?
Le dimanche 27 septembre 2020 à 12:04:03 UTC+2, Graham Dumpleton a écrit :
> Would need to see an example of the code you are talking about to
> understand better what you are talking about. In particular, how are you
> creating the threads and where? How are you waiting on the threads to
> complete, etc?
>
> Also, are you using manually configure Apache/mod_wsgi or are you using
> mod_wsgi-express? If manually configure Apache/mod_wsgi, how are you
> configuring mod_wsgi?
>
> Graham
>
> On 27 Sep 2020, at 8:01 pm, Charlie <[email protected]> wrote:
>
> I use threading module for concurrent SQL queries. Using a simple python
> script, all threads run normaly but when i use the same code in a WSGI app,
> the threads never start
>
> Thanks for your help
>
> Charlie
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/modwsgi/b2e6594a-0477-4b4e-a2b6-bba162922296n%40googlegroups.com
>
> <https://groups.google.com/d/msgid/modwsgi/b2e6594a-0477-4b4e-a2b6-bba162922296n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/modwsgi/899fb259-674c-4b02-bded-906274f18321n%40googlegroups.com.