Browse Source

Merge pull request #7346 from nocodb/fix/ioredis-type

fix: use type from ioredis for clients
pull/7347/head
աӄա 8 months ago committed by GitHub
parent
commit
5597e59e97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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