ID: TRACK-006 Status: Completed Owner: Sangita Grantha Architect Created: 2026-01-22 Updated: 2026-01-22
The current Bulk Import worker implementation uses aggressive polling (750ms interval) across multiple worker threads (6 total). This results in excessive “SELECT … FOR UPDATE” queries even when the system is idle, spamming the database logs and consuming unnecessary resources.
Reduce database load by optimizing the worker polling mechanism while maintaining responsiveness during active imports.
claimNextPendingTask to claim multiple tasks (e.g., 5 or 10) in a single transaction if available.(status, job_type, created_at) on import_task_run.LISTEN/NOTIFY or an in-memory signal to wake up the dispatcher immediately when a batch is created/resumed. (Implemented in-memory signal).delay(currentInterval) where currentInterval doubles on empty result, resets on success.LIMIT 5 in the claim query, return List<Task>.