You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TaskiqAdminMiddleware significantly slows down task triggering (.kiq()) because it blocks execution waiting for HTTP requests to complete. Each task operation creates a new HTTP client httpx.AsyncClient() instead of reusing one, adding unnecessary overhead.
The middleware should:
Avoid blocking task operations while reporting status
Reuse HTTP connections where possible httpx.AsyncClient()
Handle reporting asynchronously without impacting task throughput
This becomes particularly noticeable when triggering many tasks rapidly (e.g., in loops or batch operations). The current implementation forces sequential HTTP requests, making bulk task triggering much slower than expected.
I believe the problem is clear, but I'm happy to provide code examples or additional details if needed.