IsInflightTransaction checks whether a transaction is considered "inflight" based on its status and metadata. A transaction is considered inflight if: 1. It has a status of StatusInflight, OR 2. It has a status of StatusQueued AND has the inflight flag set to true in its metadata Parameters: - tran
(transaction *model.Transaction)
| 77 | // Returns: |
| 78 | // - bool: true if the transaction is considered inflight, false otherwise |
| 79 | func IsInflightTransaction(transaction *model.Transaction) bool { |
| 80 | return transaction.Status == StatusInflight || |
| 81 | (transaction.Status == StatusQueued && |
| 82 | transaction.MetaData != nil && |
| 83 | transaction.MetaData["inflight"] == true) |
| 84 | } |
| 85 | |
| 86 | // CommitWorker processes commit transactions from the jobs channel and sends the results to the results channel. |
| 87 | // It starts a tracing span, processes each transaction, and records relevant events and errors. |
no outgoing calls