mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-11-22 04:31:21 +00:00
rename to google-datastore, and use Date.now()
This commit is contained in:
parent
5fb43eb67c
commit
d41d7491d4
1 changed files with 2 additions and 4 deletions
|
@ -14,8 +14,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 expireTime = (skipExpire || this.expire === undefined) ? null : new Date(Date.now() + this.expire * 1000);
|
||||||
var expireTime = (skipExpire || this.expire === undefined) ? 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 = {
|
||||||
|
@ -59,7 +58,6 @@ class GoogleDatastoreDocumentStore {
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// update expiry
|
// update expiry
|
||||||
var now = new Date();
|
|
||||||
var task = {
|
var task = {
|
||||||
key: taskKey,
|
key: taskKey,
|
||||||
data: [
|
data: [
|
||||||
|
@ -70,7 +68,7 @@ class GoogleDatastoreDocumentStore {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'expiration',
|
name: 'expiration',
|
||||||
value: new Date(now.getTime() + this.expire * 1000)
|
value: new Date(Date.now() + this.expire * 1000)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
Loading…
Reference in a new issue