pub async fn transaction_cleanup_handler(
job: TransactionCleanupCronReminder,
data: ThinData<DefaultAppState>,
ctx: WorkerContext,
) -> Result<(), HandlerError>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 repositoriesctx- Worker context with attempt number and task ID
§Returns
Result<(), HandlerError>- Success or failure of cleanup processing