From ea09ba535ee96fcf8e9f3a054999ddcfc4b852a0 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Fri, 23 Sep 2022 12:52:37 +1000 Subject: [PATCH] Typeorm redis cache --- util/src/util/Database.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/src/util/Database.ts b/util/src/util/Database.ts index 2973e114..83236b8d 100644 --- a/util/src/util/Database.ts +++ b/util/src/util/Database.ts @@ -33,7 +33,12 @@ export function initDatabase(): Promise { synchronize: type !== "mongodb", logging: false, cache: { - duration: 1000 * 3, // cache all find queries for 3 seconds + duration: 1000 * 30, + type: "redis", + options: { + host: "localhost", + port: 6379, + }, }, bigNumberStrings: false, supportBigNumbers: true,