之前一更新服务器代码必须重启gunicorn进程才能reload新的code,但是这样导致了rq队列当前正在运行的任务会被移除,用以下的Procfile设置gunicorn
web: gunicorn -k gevent -w 4 -b 0.0.0.0:1226 server:app --log-level error --access-logfile access.log --error-logfile error.log --pid pid.log --reload
貌似只加上--reload
有时候并不会自动重载,还需要使用一句shell来给他发个HUP。
kill -HUP `cat pid.log`
因为是用的foreman管理进程,真心找不到该给哪个pid发,所以用了--pid
参数
这样每次pull代码后,运行下shell就能更新代码了。
网友157.*.*.192[Redmond]2022-06-30 05:44
网友157.*.*.79[Redmond]2022-06-30 05:43
网友207.*.*.128[Redmond]2022-06-30 05:43
网友185.*.*.3[火星]2022-06-30 05:37
发表评论
亲~ 评论内容是必须的哟! o(∩_∩)o
昵称
邮箱
主页
评论