This commit is contained in:
parent
7bb6dac737
commit
b43190d048
@ -59,8 +59,9 @@ export class Redis {
|
||||
log('redis is inactive, skipping');
|
||||
return;
|
||||
}
|
||||
const valid_for = (key.valid_until - (new Date)
|
||||
.getTime ()) / 1000;
|
||||
const valid_for = Math.floor(
|
||||
(key.valid_until - new Date().getTime()) / 1000
|
||||
);
|
||||
log('key is valid for %d seconds', valid_for);
|
||||
await this._redis.setex(key.index, valid_for, JSON.stringify(key));
|
||||
log('saved key');
|
||||
@ -83,4 +84,4 @@ export class Redis {
|
||||
}
|
||||
}
|
||||
|
||||
export const redis = new Redis;
|
||||
export const redis = new Redis();
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@sapphirecode/auth-server-helper",
|
||||
"version": "3.3.2",
|
||||
"version": "3.3.3",
|
||||
"main": "dist/lib/index.js",
|
||||
"author": {
|
||||
"name": "Timo Hocker",
|
||||
|
Loading…
x
Reference in New Issue
Block a user