Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions app/event_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import (
"context"
"encoding/json"
"fmt"
"strconv"
"strings"
"sync/atomic"
"time"

amqp "github.com/rabbitmq/amqp091-go"
"github.com/webitel/engine/app/flow"
"github.com/webitel/engine/model"
"github.com/webitel/engine/store"
"github.com/webitel/engine/utils"
"github.com/webitel/wlog"
"strconv"
"strings"
"sync/atomic"
"time"
)

const (
Expand Down Expand Up @@ -236,10 +237,10 @@ func (ct *TriggerEventMQ) processedMessages(messages <-chan amqp.Delivery) {
rs.variables["action"] = event
job, err := ct.store.Trigger().CreateJob(ctx, rs.domainId, rs.triggerId, rs.variables)
if err != nil {
ct.log.Error(fmt.Sprintf("could not create job: %v: %s", rs, err.Error()))
ct.log.Error("creating trigger job", wlog.Any("request", rs), wlog.Err(err))
return
}
ct.log.Info(fmt.Sprintf("started trigger \"%s\" job_id : %d", rs.name, job.Id))
ct.log.Info("started trigger", wlog.String("name", rs.name), wlog.Int64("job_id", job.Id))
}
}
}
Expand Down Expand Up @@ -317,7 +318,8 @@ func (ct *TriggerEventMQ) initQueue() error {
true,
false,
false,
false, amqp.Table{"x-queue-type": "quorum"},
false,
amqp.Table{"x-queue-type": "quorum"},
)
if err != nil {
return fmt.Errorf("could not create queue %s: %w", ct.config.Queue, err)
Expand Down
154 changes: 81 additions & 73 deletions gen/engine/trigger.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion model/cc_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func (t Trigger) EntityName() string {
}

func (t *Trigger) IsValid() AppError {

if t.Name == "" {
return NewBadRequestError("trigger.validation.name", "name is required")
}
Expand Down
Loading
Loading