From 8f71e833b9069f1a2800f5ee32817d8c89acdb94 Mon Sep 17 00:00:00 2001 From: Satont Date: Mon, 16 Dec 2024 19:58:23 +0300 Subject: [PATCH] upd --- apps/parser/internal/variables/custom_var/custom_var.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/parser/internal/variables/custom_var/custom_var.go b/apps/parser/internal/variables/custom_var/custom_var.go index 5063438d1..53d5706e6 100644 --- a/apps/parser/internal/variables/custom_var/custom_var.go +++ b/apps/parser/internal/variables/custom_var/custom_var.go @@ -3,6 +3,7 @@ package custom_var import ( "context" "errors" + "time" "github.com/samber/lo" "github.com/satont/twir/apps/parser/internal/types" @@ -41,8 +42,11 @@ var CustomVar = &types.Variable{ } if v.Type == model.CustomVarScript { + requestCtx, cancel := context.WithTimeout(ctx, 10*time.Second) + defer cancel() + filledWithVariablesValue, err := parseCtx.Services.Bus.Parser.ParseVariablesInText.Request( - ctx, + requestCtx, parser.ParseVariablesInTextRequest{ ChannelID: parseCtx.Channel.ID, ChannelName: parseCtx.Channel.Name, @@ -59,7 +63,7 @@ var CustomVar = &types.Variable{ } res, err := parseCtx.Services.Bus.Eval.Evaluate.Request( - ctx, + requestCtx, eval.EvalRequest{ Expression: filledWithVariablesValue.Data.Text, },