参考:https://blog.csdn.net/DerekTheron/article/details/105332315
参考:https://stackoverflow.com/questions/53522052/flask-app-valueerror-signal-only-works-in-main-thread
【完美解决】使用flask的run启动debug来运行puppeteer,报错【signal only works in main thread 】的解决方案:https://blog.csdn.net/weixin_43343144/article/details/110203479
解决办法:
centos:使用gunicorn来运行flask,解决异步的问题
window:使用Tornado来运行即可
其他工具比如socketio .... 来跑flask,都可以解决异步的问题
如果你直接使用flask内置调试的run方法跑Pyppeteer或其他异步的程序socketio都会报错:signal only works in main thread
解决方案:使用【生产环境】linux-gunicorn+gevent或 window-Tornado 或其他 程序来调用flask,就正常了