Fix order of dates in redis expiration calculation

This commit is contained in:
Garrett Mills 2022-09-13 23:21:44 -05:00
parent f1791b1d76
commit 5557aae543
2 changed files with 2 additions and 2 deletions

View File

@ -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",

View File

@ -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())