Authored by 姜枫

修改重启时,没保存状态

... ... @@ -12,6 +12,7 @@ import path from 'path';
import ws from '../../lib/ws';
import {
RestartInfo,
DeployInfo,
Server
} from '../models';
... ... @@ -23,8 +24,10 @@ class Restart {
async restart(info) {
let server = await Server.findByHost(info.host);
this.server = server;
this.info = info;
this.id = await DeployInfo.insertOrUpdate(this.info);
this.sshRestart({
host: server.host,
username: server.username,
... ... @@ -87,6 +90,7 @@ class Restart {
state: state
});
await RestartInfo.updateState(this.info._id, state);
await DeployInfo.updateState(this.id, state);
}
_log(msg) {
... ...