This commit is contained in:
parent
b43190d048
commit
43cf782511
@ -60,7 +60,8 @@ export class Redis {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const valid_for = Math.floor (
|
const valid_for = Math.floor (
|
||||||
(key.valid_until - new Date().getTime()) / 1000
|
(key.valid_until - (new Date)
|
||||||
|
.getTime ()) / 1000
|
||||||
);
|
);
|
||||||
log ('key is valid for %d seconds', valid_for);
|
log ('key is valid for %d seconds', valid_for);
|
||||||
await this._redis.setex (key.index, valid_for, JSON.stringify (key));
|
await this._redis.setex (key.index, valid_for, JSON.stringify (key));
|
||||||
@ -84,4 +85,4 @@ export class Redis {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const redis = new Redis();
|
export const redis = (new Redis);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user