Skip to content

Commit

Permalink
need to call toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
brettneese committed Jun 30, 2021
1 parent 16c6b49 commit 6a0b480
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ module.exports = function (cb) {
// this is, of course, going to depend on when you actually load this module
fs.readFile("/tmp/lambdaWarm", "", function (err, data) {
if (err && err.code == "ENOENT") {
fs.writeFile("/tmp/lambdaWarm", parseInt(timeWarmed, 10), function (err) {
if (err) {
return cb(err);
fs.writeFile(
"/tmp/lambdaWarm",
parseInt(timeWarmed, 10).toString(),
function (err) {
if (err) {
return cb(err);
}
return cb(null, false, new Date(parseInt(timeWarmed)));
}
return cb(null, false, new Date(parseInt(timeWarmed)));
});
);
} else {
return cb(null, true, new Date(parseInt(data)));
}
Expand Down

0 comments on commit 6a0b480

Please sign in to comment.