mirror of
https://github.com/seejohnrun/haste-server
synced 2025-07-12 16:13:54 -07:00
Merge branch 'master' into meseta/master
This commit is contained in:
commit
4f68b3d7d6
16 changed files with 1751 additions and 250 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue