pub async fn transaction_cleanup_handler(
job: TransactionCleanupCronReminder,
data: Data<ThinData<DefaultAppState>>,
attempt: Attempt,
) -> Result<(), Error>
Expand description
Handles periodic transaction cleanup jobs from the queue.
This function processes expired transactions by:
- Fetching all relayers from the system
- For each relayer, finding transactions with final statuses
- Checking if their delete_at timestamp has passed
- Validating transactions are in final states before deletion
- Deleting transactions that have expired (in parallel)
§Arguments
job
- The cron reminder job triggering the cleanupdata
- Application state containing repositoriesattempt
- Current attempt number for retry logic
§Returns
Result<(), Error>
- Success or failure of cleanup processing