Reduce Auto-Approval Wait Time for Store Owners from 10 Minutes to 10 Seconds
Key point
Eliminated the outbox queue and shortened the polling interval from 10 minutes to 10 seconds to minimize auto-approval wait times.
Details
The existing auto-approval system used a two-stage scheduler (10-minute interval) that separated candidate 'collection' from actual 'processing', resulting in a wait time of at least 3 minutes and up to 12 minutes 59 seconds from request creation to processing start.
Key Improvements
- Outbox Queue Removal and Structural Simplification: Deprecated the 'auto_approve_outbox' table used for temporarily storing candidates and changed to a method that directly queries the request table and status table. This eliminated delays in the staging stage.
- Shortened Polling Interval: Reduced the polling interval from the previous 10 minutes to 10 seconds, a 1/60 reduction. However, the retry interval was kept separate from the polling interval at 10 minutes to prevent increased load on external systems.
- N-Way Concurrent Processing and Lock Optimization: Previously, only one worker operated via ShedLock, but after improvement, all N workers poll. Concurrency issues were resolved through Redis-based request-level locks and status record checks, and logic was added to re-query the next candidate if lock acquisition fails to ensure throughput.
Results and Challenges
These improvements reduced the delay from the creation of an auto-approval eligible item to the start of processing to within 10 seconds. However, the retry interval is fixed at 10 minutes, requiring differentiated intervals based on reason, and sharing locks with the manual approval service and unifying policy logic remain future challenges.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.