From 85b931734dd5e8ff8b7dc003536772d90c25d709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCsna=20Uygur?= Date: Tue, 23 Jul 2024 15:53:30 +0200 Subject: [PATCH] feat(zeebe): fix activate jobs stream --- src/zeebe/zb/ZeebeGrpcClient.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/zeebe/zb/ZeebeGrpcClient.ts b/src/zeebe/zb/ZeebeGrpcClient.ts index 5b18238b..9200a8bc 100644 --- a/src/zeebe/zb/ZeebeGrpcClient.ts +++ b/src/zeebe/zb/ZeebeGrpcClient.ts @@ -278,16 +278,21 @@ export class ZeebeGrpcClient extends TypedEmitter< // eslint-disable-next-line no-async-promise-executor return new Promise(async (resolve, reject) => { try { + const jobs: ZB.Job[] = [] + const stream = await (await this.grpc).activateJobsStream(req) stream.on('data', (res: Grpc.ActivateJobsResponse) => { - const jobs = res.jobs.map((job) => + const parsedJobs = res.jobs.map((job) => parseVariablesAndCustomHeadersToJSON( job, inputVariableDtoToUse, customHeadersDtoToUse ) ) + jobs.push(...parsedJobs) + }) + stream.on('end', () => { resolve(jobs) }) } catch (e: unknown) {