enqueueTransactions enqueues the original transaction or its split transactions into the provided queue. It starts by determining which transactions to enqueue, then iterates through them and enqueues each one. If an error occurs during enqueuing, it logs the error and sends a notification. Paramet
(ctx context.Context, queue *Queue, originalTransaction *model.Transaction, splitTransactions []*model.Transaction)
| 2096 | // Returns: |
| 2097 | // - error: An error if any of the transactions could not be enqueued. |
| 2098 | func enqueueTransactions(ctx context.Context, queue *Queue, originalTransaction *model.Transaction, splitTransactions []*model.Transaction) error { |
| 2099 | transactionsToEnqueue := splitTransactions |
| 2100 | if len(transactionsToEnqueue) == 0 { |
| 2101 | transactionsToEnqueue = []*model.Transaction{originalTransaction} |
| 2102 | } |
| 2103 | |
| 2104 | for _, txn := range transactionsToEnqueue { |
| 2105 | if err := queue.Enqueue(ctx, txn); err != nil { |
| 2106 | notification.NotifyError(err) |
| 2107 | logrus.WithError(err).Error("failed to queue transaction") |
| 2108 | return err |
| 2109 | } |
| 2110 | } |
| 2111 | |
| 2112 | return nil |
| 2113 | } |
| 2114 | |
| 2115 | // GetTransaction retrieves a transaction by its ID from the datasource. |
| 2116 | // It starts a tracing span, fetches the transaction, and records relevant events and errors. |
no test coverage detected