Browse Source

feat: avoid flushing redis for worker container

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5711/head
mertmit 2 years ago
parent
commit
6c495b3cac
  1. 8
      packages/nocodb/src/cache/RedisCacheMgr.ts

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

@ -12,8 +12,12 @@ export default class RedisCacheMgr extends CacheMgr {
constructor(config: any) { constructor(config: any) {
super(); super();
this.client = new Redis(config); this.client = new Redis(config);
// flush the existing db with selected key (Default: 0)
this.client.flushdb(); // avoid flushing db in worker container
if (!process.env['NC_WORKER_CONTAINER']) {
// flush the existing db with selected key (Default: 0)
this.client.flushdb();
}
// TODO(cache): fetch orgs once it's implemented // TODO(cache): fetch orgs once it's implemented
const orgs = 'noco'; const orgs = 'noco';

Loading…
Cancel
Save