Skip to content

egg-scripts stop 支持 title 或者路径参数 #1735

@airyland

Description

@airyland

为了实现无中断部署,同机子部署了两个同样代码的应用运行于不同端口,前端用一个 proxy 应用分发请求到这两个应用,当要代码更新时,逐一从 proxy 解绑,拉取代码,运行代码,再次注册到 proxy。

但是在代码目录下直接使用 egg-scripts stop 时发现另一个应用也被停了,看 egg-scripts 的代码,似乎只要进程名存在 start-cluster 都会被干掉。 传入目录名 egg-scripts stop ./app2 也无效。

这里不使用 egg-scripts stop 也可以自己获取到相应 pid,但是如果 egg-scripts 支持更方便。

同个机子有多个应用使用 egg-scripts 启动的话,停止时就全部一起停止了,似乎也不合理。也可能是使用姿势错误,求释疑。

https://github.com/eggjs/egg-scripts/blob/e1a11c2988594696d68cb902c1cf58766adadd2f/lib/cmd/stop.js#L38-L41

let processList = yield this.helper.findNodeProcess(item => {
      const cmd = item.cmd;
      return cmd.includes('start-cluster');
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions