This topic created in 2929 days ago, the information mentioned may be changed or developed.
本地开发环境中 os.system 和 subprocess 都是正常执行的,但是在生产环境中,gunicorn 起了多个 worker,os.system 和 subprocess 这样的任务就全失效了。
怎样才能在 gunicorn 多进程的环境中,还能使用这种 fork 进程的 os.system 或 subprocess 命令?
8 replies • 2018-05-10 22:57:46 +08:00
 |
|
2
meik2333 May 10, 2018
应该不会吧……要不试试 celery
|
 |
|
3
a132811 May 10, 2018
试了下 os.system('ls -l') 没有问题啊!
你把日志打开看看,我的都有 --log-file gun.log --capture-output
|
 |
|
5
wzwwzw May 10, 2018
要不试试 pool ?
|
 |
|
8
param May 10, 2018 via Android
不會失效,我也是這麼用
|