QueueInflightExpiry handles queuing a transaction for inflight expiration. This method is separate from the main Enqueue to ensure expiration is handled regardless of whether the transaction is queued or processed immediately. Parameters: - ctx context.Context: The context for the operation. - tran
(ctx context.Context, transaction *model.Transaction)
| 206 | // Returns: |
| 207 | // - error: An error if the expiration could not be queued. |
| 208 | func (q *Queue) QueueInflightExpiry(ctx context.Context, transaction *model.Transaction) error { |
| 209 | if !transaction.InflightExpiryDate.IsZero() { |
| 210 | return q.queueInflightExpiry(transaction.TransactionID, transaction.InflightExpiryDate) |
| 211 | } |
| 212 | return nil |
| 213 | } |
| 214 | |
| 215 | // geTask generates a task for a transaction and assigns it to a specific queue based on the balance ID. |
| 216 | // It ensures that transactions are evenly distributed across multiple queues by hashing the balance ID. |
no test coverage detected