
7

signal only works in main thread 错误,求解决思路
source link: https://www.v2ex.com/t/808052
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

我使用 flask 框架启动一个 web 服务,在 http 请求 a 服务时,显示 signal only works in main thread 。
我尝试使用了 asyncio.run 命令,celery 框架等,启动时取消 debug,加--no-reload 参数等方法,均无效。
只有当使用 os.system('python a.py &') 时,可以运行。
当然 a 服务也比较复杂,会调用其他开源框架的程序。
求教,这样的情况该如何解决最好,真的不能直接函数调用 a(),而要运行系统命令去使用? 再有,使用 celery 难道不是相当于另起一个进程了吗? 怎么还会报错呢。谢谢
我尝试使用了 asyncio.run 命令,celery 框架等,启动时取消 debug,加--no-reload 参数等方法,均无效。
只有当使用 os.system('python a.py &') 时,可以运行。
当然 a 服务也比较复杂,会调用其他开源框架的程序。
求教,这样的情况该如何解决最好,真的不能直接函数调用 a(),而要运行系统命令去使用? 再有,使用 celery 难道不是相当于另起一个进程了吗? 怎么还会报错呢。谢谢
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK