From a3fed7d0fbb551e7cf42b648a841f7d78f7d5659 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 3 Jun 2022 23:08:15 +0900 Subject: [PATCH] fix(test): reset redis in e2e test #7986 --- packages/backend/src/db/postgre.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index e09e93f04e..50a85d6267 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -73,6 +73,7 @@ import { entities as charts } from '@/services/chart/entities.js'; import { Webhook } from '@/models/entities/webhook.js'; import { envOption } from '../env.js'; import { dbLogger } from './logger.js'; +import { redisClient } from './redis.js'; const sqlLogger = dbLogger.createSubLogger('sql', 'gray', false); @@ -217,6 +218,7 @@ export async function initDb() { export async function resetDb() { const reset = async () => { + await redisClient.FLUSHDB(); const tables = await db.query(`SELECT relname AS "table" FROM pg_class C LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) WHERE nspname NOT IN ('pg_catalog', 'information_schema')