cron job and Long process problem
Via django iam launching a thread (via middle ware the moment the first request comes) which continously fetches the twitter public steam and puts it down into the database.Assume the thread name is twitterthread.
I also have have several cron jobs which periodically interacts with other third party api services.
Observed the following Problem:
if i don't launch twitterthread cron j开发者_Python百科obs are running fine. Where as if i launch twitterthread cron jobs are not running
Any idea on what can go wrong? and any guidelines on the way to fix it.I'd advice to avoid launching threads inside the django application. Most of the times you can run the thread as a separate application.
If you deploy the app in a Apache server and you don't control it properly each Apache process will assume that a request is the first one and you could end up with more than one instance of twitterthread.
精彩评论