def start(self):
"""Start the background task thread. Since we configure
mod_wsgi with an inactivity-timeout, long-running background
tasks which don't cause new WSGI HTTP requests can
result in us hitting that inactivity-timeout. To prevent this,
while background tasks are running, we periodically send a HTTP
request to the server."""
self.__running = True
if not self.__thread:
# Create and start a thread for the caller.
self.__thread = threading.Thread(target=self.run)
self.__thread.start()
self.__keep_busy_thread = threading.Thread(
target=self.run_keep_busy)
self.__keep_busy_thread.start()
评论列表
文章目录