mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-11-22 04:31:21 +00:00
restored using null
This commit is contained in:
parent
ebc749c5e0
commit
1eeef4ede4
1 changed files with 4 additions and 4 deletions
|
@ -15,7 +15,7 @@ class GoogleDatastoreDocumentStore {
|
||||||
// Save file in a key
|
// Save file in a key
|
||||||
set(key, data, callback, skipExpire) {
|
set(key, data, callback, skipExpire) {
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
var expireTime = skipExpire ? new Date(null) : new Date(now.getTime() + this.expire * 1000);
|
var expireTime = skipExpire ? null : new Date(now.getTime() + this.expire * 1000);
|
||||||
|
|
||||||
var taskKey = this.datastore.key([this.kind, key])
|
var taskKey = this.datastore.key([this.kind, key])
|
||||||
var task = {
|
var task = {
|
||||||
|
@ -47,13 +47,13 @@ class GoogleDatastoreDocumentStore {
|
||||||
|
|
||||||
this.datastore.get(taskKey).then((entity) => {
|
this.datastore.get(taskKey).then((entity) => {
|
||||||
|
|
||||||
if (skipExpire) {
|
if (skipExpire || entity[0]["expiration"] == null) {
|
||||||
callback(entity[0]["value"]);
|
callback(entity[0]["value"]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// check for expiry
|
// check for expiry
|
||||||
if (entity[0]["expiration"] != new Date(null) && entity[0]["expiration"] < new Date()) {
|
if (entity[0]["expiration"] < new Date()) {
|
||||||
winston.info("document expired", {key: key});
|
winston.info("document expired", {key: key, expiration: entity[0]["expiration"], check: new Date(null)});
|
||||||
callback(false);
|
callback(false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue