misc: create a new publisher object for running afterjobs (#18351)
This commit is contained in:
parent
459fa64daf
commit
25e6b3e7e5
|
@ -14,6 +14,7 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import copy
|
||||
import json
|
||||
import thread
|
||||
import threading
|
||||
|
@ -112,9 +113,11 @@ class AfterJobsMiddleware(object):
|
|||
http_response = HTTPResponse()
|
||||
http_response.after_jobs = response.after_jobs
|
||||
if self.ASYNC:
|
||||
publisher = copy.copy(get_publisher())
|
||||
publisher.pgconn = None
|
||||
thread.start_new_thread(
|
||||
http_response.process_after_jobs,
|
||||
(get_publisher(),))
|
||||
(publisher,))
|
||||
else:
|
||||
http_response.process_after_jobs()
|
||||
return response
|
||||
|
|
Loading…
Reference in New Issue