diff --git a/packages/nocodb/src/lib/models/Project.ts b/packages/nocodb/src/lib/models/Project.ts index 0912e9bcf8de..437f69f65d1f 100644 --- a/packages/nocodb/src/lib/models/Project.ts +++ b/packages/nocodb/src/lib/models/Project.ts @@ -109,25 +109,25 @@ export default class Project implements ProjectType { // @ts-ignore static async get(projectId: string, ncMeta = Noco.ncMeta): Promise { - console.log('about to check cache for project data'); + // console.log('about to check cache for project data'); let projectData = projectId && (await NocoCache.get( `${CacheScope.PROJECT}:${projectId}`, CacheGetType.TYPE_OBJECT )); - console.log('Finished getting project data from cache'); + // console.log('Finished getting project data from cache'); if (!projectData) { - console.log('about to check db for project data'); + // console.log('about to check db for project data'); projectData = await ncMeta.metaGet2(null, null, MetaTable.PROJECT, { id: projectId, deleted: false, }); - console.log('Finished getting Db for project data from cache'); - console.log({ projectData }); - console.log('about to set projectdata in cache'); + // console.log('Finished getting Db for project data from cache'); + // console.log({ projectData }); + // console.log('about to set projectdata in cache'); await NocoCache.set(`${CacheScope.PROJECT}:${projectId}`, projectData); - console.log('finished to setting projectdata in cache'); + // console.log('finished to setting projectdata in cache'); } else { if (projectData.deleted) { projectData = null; diff --git a/packages/nocodb/src/lib/services/dbData/helpers.ts b/packages/nocodb/src/lib/services/dbData/helpers.ts index b0cf2f235ae0..9a9cdf3ed525 100644 --- a/packages/nocodb/src/lib/services/dbData/helpers.ts +++ b/packages/nocodb/src/lib/services/dbData/helpers.ts @@ -33,16 +33,16 @@ export async function getViewAndModelByAliasOrId(param: { tableName: string; viewName?: string; }) { - log('about to fetch project in getViewAndModelByAliasOrId'); + // log('about to fetch project in getViewAndModelByAliasOrId'); const project = await Project.getWithInfoByTitleOrId(param.projectName); - log('fetched project in getViewAndModelByAliasOrId ...'); - log(JSON.stringify({ project })); + // log('fetched project in getViewAndModelByAliasOrId ...'); + // log(JSON.stringify({ project })); const model = await Model.getByAliasOrId({ project_id: project.id, aliasOrId: param.tableName, }); - log(JSON.stringify({ model })); + // log(JSON.stringify({ model })); const view = param.viewName && @@ -50,7 +50,7 @@ export async function getViewAndModelByAliasOrId(param: { titleOrId: param.viewName, fk_model_id: model.id, })); - log(JSON.stringify({ view })) + // log(JSON.stringify({ view })) if (!model) NcError.notFound('Table not found'); return { model, view }; } diff --git a/packages/nocodb/src/lib/services/dbData/index.ts b/packages/nocodb/src/lib/services/dbData/index.ts index 506929a8db85..878c7e1143b6 100644 --- a/packages/nocodb/src/lib/services/dbData/index.ts +++ b/packages/nocodb/src/lib/services/dbData/index.ts @@ -116,24 +116,24 @@ export async function getDataList(param: { // ////////// add logs here to see cause of slow const { model, view, query = {} } = param; - console.log('getDataList about to get base ...'); + // console.log('getDataList about to get base ...'); const base = await Base.get(model.base_id); - console.log('getDataList finished getting base ...'); + // console.log('getDataList finished getting base ...'); - console.log('getDataList about to get model ...'); + // console.log('getDataList about to get model ...'); const baseModel = await Model.getBaseModelSQL({ id: model.id, viewId: view?.id, dbDriver: await NcConnectionMgrv2.get(base), }); - console.log('getDataList finished getting model ...'); + // console.log('getDataList finished getting model ...'); - console.log('getDataList about to get ast ....'); - log(JSON.stringify({ model })); - log(JSON.stringify({ query })); - log(JSON.stringify({ view })); + // console.log('getDataList about to get ast ....'); + // log(JSON.stringify({ model })); + // log(JSON.stringify({ query })); + // log(JSON.stringify({ view })); const { ast, dependencyFields } = await getAst({ model, query, view }); - console.log('getDataList finished getting ast ....'); + // console.log('getDataList finished getting ast ....'); const listArgs: any = dependencyFields; try { @@ -146,21 +146,21 @@ export async function getDataList(param: { let data = []; let count = 0; try { - console.log('getDataList about to get data ....'); - log(JSON.stringify({ ast })); - log(JSON.stringify({ listArgs })); + // console.log('getDataList about to get data ....'); + // log(JSON.stringify({ ast })); + // log(JSON.stringify({ listArgs })); data = await nocoExecute(ast, await baseModel.list(listArgs), {}, listArgs); - console.log('getDataList finished getting data ....'); + // console.log('getDataList finished getting data ....'); - console.log('getDataList about to get count ....'); + // console.log('getDataList about to get count ....'); count = await baseModel.count(listArgs); - console.log('getDataList finished getting count ....'); + // console.log('getDataList finished getting count ....'); } catch (e) { console.log(e); NcError.internalServerError('Please check server log for more details'); } - log(JSON.stringify({ data })); + // log(JSON.stringify({ data })); return new PagedResponseImpl(data, { ...query,