为什么线程在heroku中停止了?

我已经在heroku中上载了我的项目,我的脚本创建了4个线程,每个线程执行特定的任务,但是有时日志文件告诉我某些线程像这样停止了(线程13)!

为什么线程在heroku中停止了?

我该如何解决? 这是代码!

      segmentationProcess = SegmentationProcess()
      dataList = request.body.decode("utf-8").split(',')
      data = segmentationProcess.preProcess(dataList)
      lock = multiprocessing.Lock()
      thread1 = ThreadWithLogAndControls(target=segmentationProcess.searchWorkExperience,args=(data,"W",manager.result,lock))
      thread2 = ThreadWithLogAndControls(target=segmentationProcess.searchEducation,"E",lock))
      thread3 = ThreadWithLogAndControls(target=segmentationProcess.serchSkills,"S",lock))
      thread4 = ThreadWithLogAndControls(target=segmentationProcess.searchOthers,"O",lock))
      thread1.start()
      thread2.start()
      thread3.start()
      thread4.start()
      thread1.join()
      thread2.join()
      thread3.join()
      thread4.join()

使用nbmultitask库创建线程,就像多处理。 https://github.com/micahscopes/nbmultitask

daohaoa 回答:为什么线程在heroku中停止了?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3070946.html

大家都在问