Commit adb518ed authored by Efthymia Bika's avatar Efthymia Bika

Make synchronous calls on process exit

parent 61152fb0
...@@ -198,13 +198,6 @@ function getClient(name, URL, token, CAPath) { ...@@ -198,13 +198,6 @@ function getClient(name, URL, token, CAPath) {
return clients[name]; return clients[name];
} }
function kill_callback(error, stdout, stderr) {
if(error) {
console.error(stderr);
}
console.log(stdout);
}
function kill_processes() { function kill_processes() {
for(var i = 0; i < running_processes.length; i++) { for(var i = 0; i < running_processes.length; i++) {
console.log("About to kill " + running_processes[i][0].pid); console.log("About to kill " + running_processes[i][0].pid);
...@@ -212,14 +205,14 @@ function kill_processes() { ...@@ -212,14 +205,14 @@ function kill_processes() {
var lockfile = var lockfile =
path.join(BAAS_ARCHIVE_DIR, running_processes[i][1], path.join(BAAS_ARCHIVE_DIR, running_processes[i][1],
"lockfile.lock"); "lockfile.lock");
fs.stat(lockfile, function (err, stats) { try {
if(err) return console.log(err); var stats = fs.statSync(lockfile);
if(stats.isFile()) { if(stats.isFile()) {
fs.unlink(lockfile, function(error) { fs.unlinkSync(lockfile);
if(error) return console.log(error);
});
} }
}); } catch(e) {
console.log("No lockfile " + lockfile + " found");
}
} }
} }
......
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