feat: add logging functionality with LoggerService; implement log entity and controller; enhance query processing with logging support
This commit is contained in:
@ -16,6 +16,7 @@ import { QUEUE_NAMES } from "src/queue/constants";
|
||||
import { Queue, QueueEvents } from "bullmq";
|
||||
import { FunctionService } from "src/query/function/function.service";
|
||||
import { SessionService } from "../session/session.service";
|
||||
import { TLog } from "../logger/logger.types";
|
||||
|
||||
@Injectable()
|
||||
export class QueryExecuterService {
|
||||
@ -56,6 +57,7 @@ export class QueryExecuterService {
|
||||
async runQueryQueued(
|
||||
token: string,
|
||||
queryData: any,
|
||||
log: TLog,
|
||||
headers: Record<string, any> = {},
|
||||
cookies: Record<string, any> = {}
|
||||
): Promise<QueryResponse> {
|
||||
@ -66,6 +68,7 @@ export class QueryExecuterService {
|
||||
queryData,
|
||||
headers,
|
||||
cookies,
|
||||
log,
|
||||
},
|
||||
{
|
||||
removeOnComplete: true,
|
||||
@ -82,7 +85,8 @@ export class QueryExecuterService {
|
||||
token: string,
|
||||
queryData: any,
|
||||
headers: Record<string, any> = {},
|
||||
cookies: Record<string, any> = {}
|
||||
cookies: Record<string, any> = {},
|
||||
log: TLog = null
|
||||
): Promise<QueryResponse> {
|
||||
const query = await this.queryRepository.findOne({
|
||||
where: { id: token },
|
||||
@ -104,7 +108,8 @@ export class QueryExecuterService {
|
||||
const result = await vm.runScript(
|
||||
this.clearImports(query.source),
|
||||
queryData,
|
||||
headers
|
||||
headers,
|
||||
log
|
||||
);
|
||||
|
||||
if (!this.checkResponse(result)) {
|
||||
|
||||
Reference in New Issue
Block a user