From b0bbb72f35f18e604f7e95639384f20f6d7088f0 Mon Sep 17 00:00:00 2001 From: Yuan Date: Tue, 28 Aug 2018 00:35:09 +0100 Subject: [PATCH] updated to use Date(null) --- lib/document_stores/googledatastore.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/document_stores/googledatastore.js b/lib/document_stores/googledatastore.js index 22ffe5d..97385f1 100644 --- a/lib/document_stores/googledatastore.js +++ b/lib/document_stores/googledatastore.js @@ -15,7 +15,7 @@ class GoogleDatastoreDocumentStore { // Save file in a key set(key, data, callback, skipExpire) { var now = new Date(); - var expireTime = skipExpire ? null : new Date(now.getTime() + this.expire * 1000); + var expireTime = skipExpire ? new Date(null) : new Date(now.getTime() + this.expire * 1000); var taskKey = this.datastore.key([this.kind, key]) var task = { @@ -52,7 +52,7 @@ class GoogleDatastoreDocumentStore { } else { // check for expiry - if (entity[0]["expiration"] != null && entity[0]["expiration"] < new Date()) { + if (entity[0]["expiration"] != new Date(null) && entity[0]["expiration"] < new Date()) { winston.info("document expired", {key: key}); callback(false); }