1
0
Fork 0
mirror of synced 2024-10-04 03:54:37 +13:00

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,
}
export const keys = GENERIC.keys
export const get = GENERIC.get
export const store = GENERIC.store
export const destroy = GENERIC.delete
export const withCache = GENERIC.withCache
export const bustCache = GENERIC.bustCache
function performExport(funcName: string) {
// @ts-ignore
return (...args: any) => GENERIC[funcName](...args)
}
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 * as redis from "../redis/init"
const TTL_SECONDS = Duration.fromDays(7).to(DurationType.SECONDS)
const TTL_SECONDS = Duration.fromDays(7).toSeconds()
interface Invite {
email: string

View file

@ -2,7 +2,7 @@ import * as redis from "../redis/init"
import * as utils 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 {
userId: string

View file

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