Commit 06d05c82 authored by Efthymia Bika's avatar Efthymia Bika

Check if lockfile exists before removing it

parent 04ad2fe1
......@@ -212,9 +212,14 @@ function kill_processes() {
var lockfile =
path.join(BAAS_ARCHIVE_DIR, running_processes[i][1],
"lockfile.lock");
console.log("About to unlink lockfile " + lockfile);
fs.unlinkSync(lockfile);
fs.stat(lockfile, function (err, stats) {
if(err) return console.log(err);
if(stats.isFile()) {
fs.unlink(lockfile, function(error) {
if(error) return console.log(error);
});
}
});
}
}
......
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