added cache-saving in try-catch block

This commit is contained in:
h0x0er 2022-09-14 12:07:04 +05:30
commit 56018545c2

View file

@ -70,11 +70,15 @@ import path from "path";
console.log("Service log:");
console.log(journalLog);
}
const cmd = "sudo";
const args = ["cp", path.join(__dirname, "cache.txt"), cacheFile];
cp.execFileSync(cmd, args);
const cacheResult = await cache.saveCache([cacheFile], cacheKey);
console.log(cacheResult);
try {
const cmd = "sudo";
const args = ["cp", path.join(__dirname, "cache.txt"), cacheFile];
cp.execFileSync(cmd, args);
const cacheResult = await cache.saveCache([cacheFile], cacheKey);
console.log(cacheResult);
} catch (exception) {
console.log(exception);
}
})();
function sleep(ms) {