rename to google-datastore, and use Date.now()
This commit is contained in:
parent
5fb43eb67c
commit
d41d7491d4
@ -14,8 +14,7 @@ class GoogleDatastoreDocumentStore {
|
||||
|
||||
// Save file in a key
|
||||
set(key, data, callback, skipExpire) {
|
||||
var now = new Date();
|
||||
var expireTime = (skipExpire || this.expire === undefined) ? null : new Date(now.getTime() + this.expire * 1000);
|
||||
var expireTime = (skipExpire || this.expire === undefined) ? null : new Date(Date.now() + this.expire * 1000);
|
||||
|
||||
var taskKey = this.datastore.key([this.kind, key])
|
||||
var task = {
|
||||
@ -59,7 +58,6 @@ class GoogleDatastoreDocumentStore {
|
||||
else {
|
||||
|
||||
// update expiry
|
||||
var now = new Date();
|
||||
var task = {
|
||||
key: taskKey,
|
||||
data: [
|
||||
@ -70,7 +68,7 @@ class GoogleDatastoreDocumentStore {
|
||||
},
|
||||
{
|
||||
name: 'expiration',
|
||||
value: new Date(now.getTime() + this.expire * 1000)
|
||||
value: new Date(Date.now() + this.expire * 1000)
|
||||
}
|
||||
]
|
||||
};
|
Loading…
Reference in New Issue
Block a user