Merge branch 'master' into meseta/master

This commit is contained in:
John Crepezzi 2020-10-06 01:13:07 -04:00
commit 4f68b3d7d6
16 changed files with 1751 additions and 250 deletions

View file

@ -15,7 +15,7 @@ class GoogleDatastoreDocumentStore {
// Save file in a key
set(key, data, callback, skipExpire) {
var expireTime = (skipExpire || this.expire === undefined) ? null : new Date(Date.now() + this.expire * 1000);
var taskKey = this.datastore.key([this.kind, key])
var task = {
key: taskKey,
@ -31,9 +31,9 @@ class GoogleDatastoreDocumentStore {
}
]
};
this.datastore.insert(task).then(() => {
callback(true);
callback(true);
})
.catch(err => {
callback(false);
@ -43,9 +43,8 @@ class GoogleDatastoreDocumentStore {
// Get a file from a key
get(key, callback, skipExpire) {
var taskKey = this.datastore.key([this.kind, key])
this.datastore.get(taskKey).then((entity) => {
if (skipExpire || entity[0]["expiration"] == null) {
callback(entity[0]["value"]);
}
@ -56,7 +55,6 @@ class GoogleDatastoreDocumentStore {
callback(false);
}
else {
// update expiry
var task = {
key: taskKey,