Skip to content

Commit

Permalink
feat: add ignoreSIGTERM config
Browse files Browse the repository at this point in the history
  • Loading branch information
lemanzhang committed May 6, 2019
1 parent 4c73d3a commit 4ff24c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/proxy/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,12 @@ function masterEventHandler() {
}
}
});

if (config.ignoreSIGTERM) {
process.on('SIGTERM', () => {
logger.info('Received SIGTERM signal from system, but ignore it. This message usually indicates that TSW is running in a container.');
});
}
}

function startMasterMonitor() {
Expand Down
2 changes: 2 additions & 0 deletions bin/tsw/default/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,5 @@ this.tswL5api['cmem.tsw.sh'] = this.tswL5api['cmem.tsw.sz'];
this.tswL5api['cmem.tsw.tj'] = this.tswL5api['cmem.tsw.sh'];
this.tswL5api['cmem.tsw.h5test'] = this.tswL5api['cmem.tsw.sz'];

// 指定一个布尔值,表明TSW Master进程是否忽略来自系统的SIGTERM信号
this.ignoreSIGTERM = false;

0 comments on commit 4ff24c2

Please sign in to comment.