Browse Source

fix: various errors for at

pull/7391/head
mertmit 11 months ago
parent
commit
4403d80d45
  1. 30
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

30
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

@ -146,6 +146,11 @@ export class AtImportProcessor {
this.debugLog(log);
};
const logWarning = (log) => {
this.jobsLogService.sendLog(job, { message: `WARNING: ${log}` });
this.debugLog(log);
};
const logDetailed = (log) => {
if (debugMode) this.jobsLogService.sendLog(job, { message: log });
this.debugLog(log);
@ -291,7 +296,7 @@ export class AtImportProcessor {
rating: UITypes.Rating,
formula: UITypes.Formula,
rollup: UITypes.Rollup,
count: UITypes.Count,
count: UITypes.Rollup,
lookup: UITypes.Lookup,
autoNumber: UITypes.AutoNumber,
barcode: UITypes.SingleLineText,
@ -1091,7 +1096,7 @@ export class AtImportProcessor {
ARRAYCOMPACT: '',
ARRAYJOIN: '',
ARRAYUNIQUE: '',
AVERAGE: 'average',
AVERAGE: 'avg',
CONCATENATE: '',
COUNT: 'count',
COUNTA: '',
@ -1197,6 +1202,7 @@ export class AtImportProcessor {
logDetailed(`NC API: dbTableColumn.create ROLLUP ${ncName.title}`);
const _perfStart = recordPerfStart();
try {
const ncTbl: any = await this.columnsService.columnAdd({
tableId: srcTableId,
column: {
@ -1226,6 +1232,11 @@ export class AtImportProcessor {
aTblColumns[i].name,
ncTbl.id,
);
} catch (e) {
logWarning(
`Skipped creating rollup column ${aTblColumns[i].name} :: ${e.message}`,
);
}
}
}
}
@ -1803,9 +1814,14 @@ export class AtImportProcessor {
},
req: { user: syncDB.user, clientIp: '' },
})
.catch((e) =>
e.message ? logBasic(`NOTICE: ${e.message}`) : console.log(e),
),
.catch((e) => {
if (e.message) {
// TODO enable after fixing user invite role issue
// logWarning(e.message);
} else {
console.log(e);
}
}),
);
recordPerfStats(_perfStart, 'auth.baseUserAdd');
}
@ -2097,12 +2113,16 @@ export class AtImportProcessor {
// insert filters
for (let i = 0; i < ncFilters.length; i++) {
const _perfStart = recordPerfStart();
try {
await this.filtersService.filterCreate({
viewId: viewId,
filter: ncFilters[i],
user: syncDB.user,
req: {},
});
} catch (e) {
logWarning(`Skipped creating filter for ${viewId} :: ${e.message}`);
}
recordPerfStats(_perfStart, 'dbTableFilter.create');
rtc.filter++;

Loading…
Cancel
Save