Browse Source

fix: deprecate getAll command

pull/7464/head
mertmit 10 months ago
parent
commit
8bec1ad6e9
  1. 1
      packages/nocodb/src/cache/CacheMgr.ts
  2. 5
      packages/nocodb/src/cache/NocoCache.ts
  3. 5
      packages/nocodb/src/cache/RedisCacheMgr.ts
  4. 5
      packages/nocodb/src/cache/RedisMockCacheMgr.ts
  5. 3
      packages/nocodb/src/models/User.ts

1
packages/nocodb/src/cache/CacheMgr.ts vendored

@ -8,7 +8,6 @@ export default abstract class CacheMgr {
): Promise<any>; ): Promise<any>;
public abstract incrby(key: string, value: number): Promise<any>; public abstract incrby(key: string, value: number): Promise<any>;
public abstract del(key: string): Promise<any>; public abstract del(key: string): Promise<any>;
public abstract getAll(pattern: string): Promise<any[]>;
public abstract delAll(scope: string, pattern: string): Promise<any[]>; public abstract delAll(scope: string, pattern: string): Promise<any[]>;
public abstract getList( public abstract getList(
scope: string, scope: string,

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

@ -52,11 +52,6 @@ export default class NocoCache {
return this.client.get(`${this.prefix}:${key}`, type); return this.client.get(`${this.prefix}:${key}`, type);
} }
public static async getAll(pattern: string): Promise<any[]> {
if (this.cacheDisabled) return Promise.resolve([]);
return this.client.getAll(`${this.prefix}:${pattern}`);
}
public static async del(key): Promise<boolean> { public static async del(key): Promise<boolean> {
if (this.cacheDisabled) return Promise.resolve(true); if (this.cacheDisabled) return Promise.resolve(true);
return this.client.del(`${this.prefix}:${key}`); return this.client.del(`${this.prefix}:${key}`);

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

@ -126,11 +126,6 @@ export default class RedisCacheMgr extends CacheMgr {
return this.client.incrby(key, value); return this.client.incrby(key, value);
} }
// @ts-ignore
async getAll(pattern: string): Promise<any> {
return this.client.hgetall(pattern);
}
// @ts-ignore // @ts-ignore
async delAll(scope: string, pattern: string): Promise<any[]> { async delAll(scope: string, pattern: string): Promise<any[]> {
// Example: nc:<orgs>:model:*:<id> // Example: nc:<orgs>:model:*:<id>

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

@ -123,11 +123,6 @@ export default class RedisMockCacheMgr extends CacheMgr {
return this.client.incrby(key, value); return this.client.incrby(key, value);
} }
// @ts-ignore
async getAll(pattern: string): Promise<any> {
return this.client.hgetall(pattern);
}
// @ts-ignore // @ts-ignore
async delAll(scope: string, pattern: string): Promise<any[]> { async delAll(scope: string, pattern: string): Promise<any[]> {
// Example: nc:<orgs>:model:*:<id> // Example: nc:<orgs>:model:*:<id>

3
packages/nocodb/src/models/User.ts

@ -147,10 +147,7 @@ export default class User implements UserType {
} }
static async isFirst(ncMeta = Noco.ncMeta) { static async isFirst(ncMeta = Noco.ncMeta) {
const isFirst = !(await NocoCache.getAll(`${CacheScope.USER}:*`))?.length;
if (isFirst)
return !(await ncMeta.metaGet2(null, null, MetaTable.USERS, {})); return !(await ncMeta.metaGet2(null, null, MetaTable.USERS, {}));
return false;
} }
public static async count( public static async count(

Loading…
Cancel
Save