misc: use threading module to start afterjobs threads (#18781)
This commit is contained in:
parent
4e681fa9ee
commit
726ee066a1
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue