refactor: Reduce payload size when fetching workflows to prevent memory issues (#5293)

This commit is contained in:
Omar Ajoue 2023-01-31 11:09:33 +01:00 committed by GitHub
parent 1d85e232e5
commit c7e9a4375f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -223,8 +223,19 @@ export class ExecutionsService {
});
}
let query = Db.collections.Execution.createQueryBuilder()
.select()
// Omit `data` from the Execution since it is the largest and not necesary for the list.
let query = Db.collections.Execution.createQueryBuilder('execution')
.select([
'execution.id',
'execution.finished',
'execution.mode',
'execution.retryOf',
'execution.retrySuccessId',
'execution.waitTill',
'execution.startedAt',
'execution.stoppedAt',
'execution.workflowData',
])
.orderBy('id', 'DESC')
.take(limit)
.where(findWhere);