mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-11-01 03:21: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
|
||||
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 a new issue