Fix order of dates in redis expiration calculation

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

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