Browse Source

fix: use Redis type in cache managers

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/7346/head
mertmit 12 months ago
parent
commit
54714ac6c3
  1. 4
      packages/nocodb/src/cache/RedisCacheMgr.ts
  2. 5
      packages/nocodb/src/cache/RedisMockCacheMgr.ts

4
packages/nocodb/src/cache/RedisCacheMgr.ts vendored

@ -6,7 +6,7 @@ import { CacheDelDirection, CacheGetType, CacheScope } from '~/utils/globals';
const log = debug('nc:cache');
export default class RedisCacheMgr extends CacheMgr {
client: any;
client: Redis;
prefix: string;
constructor(config: any) {
@ -300,7 +300,7 @@ export default class RedisCacheMgr extends CacheMgr {
async destroy(): Promise<boolean> {
log('RedisCacheMgr::destroy: destroy redis');
return this.client.flushdb();
return this.client.flushdb().then((r) => r === 'OK');
}
async export(): Promise<any> {

5
packages/nocodb/src/cache/RedisMockCacheMgr.ts vendored

@ -1,11 +1,12 @@
import debug from 'debug';
import Redis from 'ioredis-mock';
import CacheMgr from './CacheMgr';
import type IORedis from 'ioredis';
import { CacheDelDirection, CacheGetType, CacheScope } from '~/utils/globals';
const log = debug('nc:cache');
export default class RedisMockCacheMgr extends CacheMgr {
client: any;
client: IORedis;
prefix: string;
constructor() {
@ -300,7 +301,7 @@ export default class RedisMockCacheMgr extends CacheMgr {
async destroy(): Promise<boolean> {
log('RedisMockCacheMgr::destroy: destroy redis');
return this.client.flushdb();
return this.client.flushdb().then((r) => r === 'OK');
}
async export(): Promise<any> {

Loading…
Cancel
Save