1
0
mirror of https://github.com/seejohnrun/haste-server.git synced 2025-12-15 11:45:55 +00:00

Merge branch 'master' into meseta/master

This commit is contained in:
John Crepezzi
2020-10-06 01:13:07 -04:00
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,