MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / processTransactionAsync

Function processTransactionAsync

transaction.go:1852–1874  ·  view source on GitHub ↗
(ctx context.Context, l *LedgerForge, transaction *model.Transaction, originalRef string, originalTxnID string, transactions []*model.Transaction)

Source from the content-addressed store, hash-verified

1850}
1851
1852func 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.

Callers 1

QueueTransactionMethod · 0.85

Calls 4

enqueueTransactionsFunction · 0.85
processTxnsMethod · 0.80
ErrorMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected