run commands regardless of restart reason
parent
3ac4bb7518
commit
fc0b9e0064
|
|
@ -10,11 +10,6 @@ setInterval(function update() {
|
||||||
if(remoteHash !== localHash) {
|
if(remoteHash !== localHash) {
|
||||||
log.info('remote hash:', remoteHash);
|
log.info('remote hash:', remoteHash);
|
||||||
log.info('local hash: ', localHash);
|
log.info('local hash: ', localHash);
|
||||||
log.info('attempting to fetch new version');
|
|
||||||
|
|
||||||
execSync(`git fetch`);
|
|
||||||
execSync(`git pull`);
|
|
||||||
execSync(`yarn`);
|
|
||||||
|
|
||||||
log.info('killing relay...');
|
log.info('killing relay...');
|
||||||
try {
|
try {
|
||||||
|
|
@ -30,7 +25,14 @@ setInterval(function update() {
|
||||||
proc = spawn('node', ['relay'], { stdio: "inherit" });
|
proc = spawn('node', ['relay'], { stdio: "inherit" });
|
||||||
|
|
||||||
proc.on('exit', () => {
|
proc.on('exit', () => {
|
||||||
log.info('relay exitted, restarting...');
|
log.info('relay exitted');
|
||||||
|
log.info('attempting to fetch new version');
|
||||||
|
|
||||||
|
execSync(`git fetch`);
|
||||||
|
execSync(`git pull`);
|
||||||
|
execSync(`yarn`);
|
||||||
|
|
||||||
|
log.info('restarting...')
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
keepAlive();
|
keepAlive();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
|
||||||
Reference in New Issue