Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed Dec 16, 2024
1 parent 738fdfe commit 8f71e83
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/parser/internal/variables/custom_var/custom_var.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package custom_var
import (
"context"
"errors"
"time"

"github.com/samber/lo"
"github.com/satont/twir/apps/parser/internal/types"
Expand Down Expand Up @@ -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,
Expand All @@ -59,7 +63,7 @@ var CustomVar = &types.Variable{
}

res, err := parseCtx.Services.Bus.Eval.Evaluate.Request(
ctx,
requestCtx,
eval.EvalRequest{
Expression: filledWithVariablesValue.Data.Text,
},
Expand Down

0 comments on commit 8f71e83

Please sign in to comment.