better error handling for rigctld process

This commit is contained in:
DJ2LS 2022-11-18 00:23:13 +01:00
parent 7d99f89911
commit 119c568ebe

View file

@ -822,27 +822,24 @@ function close_all() {
// RUN RIGCTLD
ipcMain.on('request-start-rigctld',(event, data)=>{
try{
let rigctld_proc = spawn(data.path, data.parameters);
rigctld_proc.on('exit', function (code) {
console.log('rigctld process exited with code ' + code);
// if rigctld crashes, error code is -2
// then we are going to restart rigctld
// this "fixes" a problem with latest rigctld on raspberry pi
//if (code == -2){
// setTimeout(ipcRenderer.send('request-start-rigctld', data), 500);
//}
//let rigctld_proc = spawn(data.path, data.parameters);
});
} catch (e) {
console.log(e);
}
rigctld_proc.on('exit', function (code) {
console.log('rigctld process exited with code ' + code);
// if rigctld crashes, error code is -2
// then we are going to restart rigctld
// this "fixes" a problem with latest rigctld on raspberry pi
//if (code == -2){
// setTimeout(ipcRenderer.send('request-start-rigctld', data), 500);
//}
//let rigctld_proc = spawn(data.path, data.parameters);
});
/*
const rigctld = exec(data.path, data.parameters);
rigctld.stdout.on("data", data => {