From 9ba52021d0bfebae42d3e9f0c834dcd3aa9f7fbe Mon Sep 17 00:00:00 2001 From: Stevche Radevski Date: Thu, 22 Aug 2024 13:33:11 +0200 Subject: [PATCH] fix: Log on error by default in async workflow executions (#8723) --- .../src/utils/workflow-orchestrator-storage.ts | 2 ++ .../src/utils/workflow-orchestrator-storage.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/modules/workflow-engine-inmemory/src/utils/workflow-orchestrator-storage.ts b/packages/modules/workflow-engine-inmemory/src/utils/workflow-orchestrator-storage.ts index a02a9f44bc..45280a7fa9 100644 --- a/packages/modules/workflow-engine-inmemory/src/utils/workflow-orchestrator-storage.ts +++ b/packages/modules/workflow-engine-inmemory/src/utils/workflow-orchestrator-storage.ts @@ -165,6 +165,7 @@ export class InMemoryDistributedTransactionStorage const inter = setTimeout(async () => { await this.workflowOrchestratorService_.run(workflowId, { transactionId, + logOnError: true, throwOnError: false, }) }, interval * 1e3) @@ -322,6 +323,7 @@ export class InMemoryDistributedTransactionStorage try { // With running the job after setting a new timer we basically allow for concurrent runs, unless we add idempotency keys once they are supported. await this.workflowOrchestratorService_.run(jobId, { + logOnError: true, throwOnError: false, }) } catch (e) { diff --git a/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts b/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts index 1a9d8ac4d1..6ea40c393b 100644 --- a/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts +++ b/packages/modules/workflow-engine-redis/src/utils/workflow-orchestrator-storage.ts @@ -125,6 +125,7 @@ export class RedisDistributedTransactionStorage private async executeTransaction(workflowId: string, transactionId: string) { return await this.workflowOrchestratorService_.run(workflowId, { transactionId, + logOnError: true, throwOnError: false, }) } @@ -137,6 +138,7 @@ export class RedisDistributedTransactionStorage // TODO: In the case of concurrency being forbidden, we want to generate a predictable transaction ID and rely on the idempotency // of the transaction to ensure that the transaction is only executed once. return await this.workflowOrchestratorService_.run(jobId, { + logOnError: true, throwOnError: false, }) } catch (e) {