From 0cf317ee370471c3167596e85d1d251980533731 Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 6 Oct 2022 11:47:12 +0200 Subject: [PATCH] Add a delay to the fact retrievers to prevent errors Signed-off-by: Leon --- .../src/service/fact/FactRetrieverEngine.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.ts b/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.ts index 2d738b7de8..a316b984ed 100644 --- a/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.ts +++ b/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.ts @@ -126,6 +126,9 @@ export class DefaultFactRetrieverEngine implements FactRetrieverEngine { frequency: { cron: cronExpression }, fn: this.createFactRetrieverHandler(factRetriever, lifecycle), timeout: timeLimit, + // We add a delay in order to prevent errors due to the + // fact that the backend is not yet online in a cold-start scenario + initialDelay: Duration.fromObject({ seconds: 5 }), }); newRegs.push(factRetriever.id); } catch (e) {