From b5123630f88fdfb7d5cbeecad3abea990bab95a8 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 1 Aug 2024 15:55:30 +0700 Subject: [PATCH] clear data in redis --- src/controllers/AuthRoleController.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/controllers/AuthRoleController.ts b/src/controllers/AuthRoleController.ts index e1ac90d6..3084cf32 100644 --- a/src/controllers/AuthRoleController.ts +++ b/src/controllers/AuthRoleController.ts @@ -219,6 +219,15 @@ export class AuthRoleController extends Controller { ...newAttrs.map((attr) => this.authRoleAttrRepo.save(attr)), ]); + const redisClient = await this.redis.createClient({ + host: REDIS_HOST, + port: REDIS_PORT, + }); + + await redisClient.flushdb(function (err: any, succeeded: any) { + console.log(succeeded); // will be true if successfull + }); + return new HttpSuccess(); }