Commit e5285638 authored by Eriksson Monteiro's avatar Eriksson Monteiro

fix node launch. use pid file

parent d8f6b6ea
...@@ -947,6 +947,8 @@ int BrowserMainLoop::CreateMillixNode() { ...@@ -947,6 +947,8 @@ int BrowserMainLoop::CreateMillixNode() {
options.new_process_group = true; options.new_process_group = true;
#endif #endif
millix_command_line.AppendArg("index.dist.js"); millix_command_line.AppendArg("index.dist.js");
millix_command_line.AppendArg("--pid-file");
millix_command_line.AppendArg("./millix-node.pid");
// --enable-logging --v=2 // --enable-logging --v=2
LOG(INFO) << "Starting millix node: " << millix_command_line.GetCommandLineString(); LOG(INFO) << "Starting millix node: " << millix_command_line.GetCommandLineString();
......
...@@ -81,7 +81,7 @@ if (argv.testPort) { ...@@ -81,7 +81,7 @@ if (argv.testPort) {
let pidFile = argv.pidFile; let pidFile = argv.pidFile;
const dataFolder = argv.dataFolder ? const dataFolder = argv.dataFolder ?
path.isAbsolute(argv.dataFolder) ? argv.dataFolder : path.join(os.homedir(), argv.dataFolder) path.isAbsolute(argv.dataFolder) ? argv.dataFolder : path.join(os.homedir(), argv.dataFolder)
: undefined; : path.join(os.homedir(), config.DATABASE_CONNECTION.FOLDER);
if (dataFolder) { if (dataFolder) {
config.STORAGE_CONNECTION.FOLDER = path.join(dataFolder, '/storage/'); config.STORAGE_CONNECTION.FOLDER = path.join(dataFolder, '/storage/');
config.STORAGE_CONNECTION.PENDING_TO_SEND = path.join(dataFolder, '/storage/sending.log'); config.STORAGE_CONNECTION.PENDING_TO_SEND = path.join(dataFolder, '/storage/sending.log');
...@@ -125,7 +125,6 @@ process.on('SIGINT', async function() { ...@@ -125,7 +125,6 @@ process.on('SIGINT', async function() {
} }
}); });
const checkPIDFile = () => { const checkPIDFile = () => {
if (!pidFile) { if (!pidFile) {
console.log('pid file not in use'); console.log('pid file not in use');
...@@ -165,7 +164,7 @@ const checkTangledAdvertisementProcess = () => { ...@@ -165,7 +164,7 @@ const checkTangledAdvertisementProcess = () => {
encoding: null encoding: null
}, (err, response, body) => { }, (err, response, body) => {
if (err || response.statusCode !== 200) { if (err || response.statusCode !== 200) {
tangledProcess = childProcess.spawn(process.execPath, [`${__dirname}/tangled-advertisement.js`], { stdio: 'ignore' }); tangledProcess = childProcess.spawn(process.execPath, [`${__dirname}/tangled-advertisement.js`, '--pid-file', './tangled-advertisement.pid'], { stdio: 'ignore' });
} }
setTimeout(() => checkTangledAdvertisementProcess(), 60000); setTimeout(() => checkTangledAdvertisementProcess(), 60000);
}); });
...@@ -173,7 +172,7 @@ const checkTangledAdvertisementProcess = () => { ...@@ -173,7 +172,7 @@ const checkTangledAdvertisementProcess = () => {
eventBus.on('wallet_unlock', () => { eventBus.on('wallet_unlock', () => {
if (!tangledProcess) { if (!tangledProcess) {
tangledProcess = childProcess.spawn(process.execPath, [`${__dirname}/tangled-advertisement.js`], { stdio: 'ignore' }); tangledProcess = childProcess.spawn(process.execPath, [`${__dirname}/tangled-advertisement.js`, '--pid-file', './tangled-advertisement.pid'], { stdio: 'ignore' });
setTimeout(() => checkTangledAdvertisementProcess(), 60000); setTimeout(() => checkTangledAdvertisementProcess(), 60000);
} }
}); });
...@@ -204,4 +203,3 @@ logger.initialize().then(() => { ...@@ -204,4 +203,3 @@ logger.initialize().then(() => {
} }
}); });
}); });
//millix v1.19.2-tangled
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment