misc: use threading module to start afterjobs threads (#18781)

This commit is contained in:
Frédéric Péters 2017-09-19 11:35:06 +02:00
parent 4e681fa9ee
commit 726ee066a1
1 changed files with 2 additions and 3 deletions

View File

@ -15,7 +15,7 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>.
import json
import thread
import threading
import urllib
from django.http import HttpResponseBadRequest, HttpResponseRedirect
@ -111,8 +111,7 @@ class AfterJobsMiddleware(object):
http_response = HTTPResponse()
http_response.after_jobs = response.after_jobs
if self.ASYNC:
thread.start_new_thread(
http_response.process_after_jobs, ())
threading.Thread(target=http_response.process_after_jobs).start()
else:
http_response.process_after_jobs()
return response