Fix order of dates in redis expiration calculation
This commit is contained in:
parent
f1791b1d76
commit
5557aae543
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@extollo/lib",
|
||||
"version": "0.14.3",
|
||||
"version": "0.14.4",
|
||||
"description": "The framework library that lifts up your code.",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
|
2
src/support/cache/RedisCache.ts
vendored
2
src/support/cache/RedisCache.ts
vendored
@ -76,7 +76,7 @@ export class RedisCache extends Cache {
|
||||
await this.redis.multi()
|
||||
.tap(redis => redis.set(key, value))
|
||||
.when(Boolean(expires), redis => {
|
||||
const seconds = Math.round(((new Date()).getTime() - expires!.getTime()) / 1000) // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
||||
const seconds = Math.round((expires!.getTime() - (new Date()).getTime()) / 1000) // eslint-disable-line @typescript-eslint/no-non-null-assertion
|
||||
return redis.expire(key, seconds)
|
||||
})
|
||||
.tap(pipeline => pipeline.exec())
|
||||
|
Loading…
Reference in New Issue
Block a user