在Django中使用Luigi

时间:2019-01-21 16:09:58

标签: python django luigi

我使用Luigi框架开发了一个管道。

现在,我想在Web应用程序(Django)中通过按一个按钮来触发它。

但是,当我从Web应用程序运行管道时,出现以下错误:

  

signal.signal(signal.SIGUSR1,self.handle_interrupt)

     

ValueError:信号仅在主线程中起作用”

这是我的代码:

def run_pipeline():
   p = Pipeline()
   exec p

def index_view(request):
    if request.GET.get('btnRun'):
        t = threading.Thread(target=run_pipeline)
        t.setDaemon(True)
        t.start()
    return render(request, 'index.html')

0 个答案:

没有答案
相关问题