PR comments and possible fix for test failures.

This commit is contained in:
mike12345567 2023-11-17 16:33:58 +00:00
parent 34d6a41042
commit 57fa9baef8
4 changed files with 16 additions and 8 deletions

View File

@ -18,9 +18,14 @@ export enum TTL {
ONE_DAY = 86400, ONE_DAY = 86400,
} }
export const keys = GENERIC.keys function performExport(funcName: string) {
export const get = GENERIC.get // @ts-ignore
export const store = GENERIC.store return (...args: any) => GENERIC[funcName](...args)
export const destroy = GENERIC.delete }
export const withCache = GENERIC.withCache
export const bustCache = GENERIC.bustCache export const keys = performExport("keys")
export const get = performExport("get")
export const store = performExport("store")
export const destroy = performExport("delete")
export const withCache = performExport("withCache")
export const bustCache = performExport("bustCache")

View File

@ -4,7 +4,7 @@ import env from "../environment"
import { getTenantId } from "../context" import { getTenantId } from "../context"
import * as redis from "../redis/init" import * as redis from "../redis/init"
const TTL_SECONDS = Duration.fromDays(7).to(DurationType.SECONDS) const TTL_SECONDS = Duration.fromDays(7).toSeconds()
interface Invite { interface Invite {
email: string email: string

View File

@ -2,7 +2,7 @@ import * as redis from "../redis/init"
import * as utils from "../utils" import * as utils from "../utils"
import { Duration, DurationType } from "../utils" import { Duration, DurationType } from "../utils"
const TTL_SECONDS = Duration.fromHours(1).to(DurationType.SECONDS) const TTL_SECONDS = Duration.fromHours(1).toSeconds()
interface PasswordReset { interface PasswordReset {
userId: string userId: string

View File

@ -28,6 +28,9 @@ export class Duration {
toMs: () => { toMs: () => {
return Duration.convert(from, DurationType.MILLISECONDS, duration) return Duration.convert(from, DurationType.MILLISECONDS, duration)
}, },
toSeconds: () => {
return Duration.convert(from, DurationType.SECONDS, duration)
},
} }
} }