From 9350287281bdcf9672efa901952df179fc3156b4 Mon Sep 17 00:00:00 2001 From: kpacha Date: Wed, 28 Feb 2024 20:06:35 +0100 Subject: [PATCH 1/2] set the timeouts for the internal endpoint and backend(s) Signed-off-by: kpacha --- async/asyncagent.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/async/asyncagent.go b/async/asyncagent.go index 2b53009cb..92ba4831c 100644 --- a/async/asyncagent.go +++ b/async/asyncagent.go @@ -1,7 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 /* - */ package async @@ -66,8 +65,15 @@ func (a AgentStarter) Start( logger.Debug(fmt.Sprintf("[SERVICE: AsyncAgent][%s] Starting the async agent", agent.Name)) + for i := range agent.Backend { + b := agent.Backend[i] + b.Timeout = agent.Consumer.Timeout + agent.Backend[i] = b + } + endpoint := &config.EndpointConfig{ Endpoint: agent.Name, + Timeout: agent.Consumer.Timeout, Backend: agent.Backend, ExtraConfig: agent.ExtraConfig, } From ebe2413ddb02f96a44371166752984caf93b5b4f Mon Sep 17 00:00:00 2001 From: kpacha Date: Thu, 7 Mar 2024 15:31:53 +0100 Subject: [PATCH 2/2] simplify the timeout assignation Signed-off-by: kpacha --- async/asyncagent.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/async/asyncagent.go b/async/asyncagent.go index 92ba4831c..2afc3b0d3 100644 --- a/async/asyncagent.go +++ b/async/asyncagent.go @@ -66,9 +66,7 @@ func (a AgentStarter) Start( logger.Debug(fmt.Sprintf("[SERVICE: AsyncAgent][%s] Starting the async agent", agent.Name)) for i := range agent.Backend { - b := agent.Backend[i] - b.Timeout = agent.Consumer.Timeout - agent.Backend[i] = b + agent.Backend[i].Timeout = agent.Consumer.Timeout } endpoint := &config.EndpointConfig{