(ctx context.Context, l *LedgerForge, transaction *model.Transaction, originalRef string, originalTxnID string, transactions []*model.Transaction)
| 1850 | } |
| 1851 | |
| 1852 | func processTransactionAsync(ctx context.Context, l *LedgerForge, transaction *model.Transaction, originalRef string, originalTxnID string, transactions []*model.Transaction) { |
| 1853 | go func() { |
| 1854 | if err := asyncTxnSemaphore.Acquire(ctx, 1); err != nil { |
| 1855 | logrus.WithError(err).Error("failed to acquire async txn semaphore") |
| 1856 | return |
| 1857 | } |
| 1858 | defer asyncTxnSemaphore.Release(1) |
| 1859 | |
| 1860 | ctx, span := tracer.Start(ctx, "ProcessTransactionAsync") |
| 1861 | defer span.End() |
| 1862 | |
| 1863 | queueTransactions, err := l.processTxns(ctx, transaction, transactions, originalTxnID, originalRef) |
| 1864 | if err != nil { |
| 1865 | span.RecordError(err) |
| 1866 | } |
| 1867 | |
| 1868 | if !transaction.SkipQueue { |
| 1869 | if err := enqueueTransactions(ctx, l.queue, transaction, queueTransactions); err != nil { |
| 1870 | span.RecordError(err) |
| 1871 | } |
| 1872 | } |
| 1873 | }() |
| 1874 | } |
| 1875 | |
| 1876 | // handleSplitTransactions attempts to split a transaction into multiple transactions if needed. |
| 1877 | // It starts a tracing span, attempts to split the transaction, and validates the result. |
no test coverage detected