Indexing works in parallel instead of series. - #1464
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThe application runs folder indexing in a dedicated, configurable process pool. After successful indexing, it queues the AI-tagging sweep on the general executor. Tests verify executor separation and callback timing. ChangesFolder indexing execution
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant FolderRoute
participant indexing_executor
participant tagging_executor
participant post_AI_tagging_enabled_sequence
FolderRoute->>indexing_executor: Submit folder indexing
indexing_executor-->>FolderRoute: Complete indexing future
FolderRoute->>tagging_executor: Queue tagging sweep
tagging_executor->>post_AI_tagging_enabled_sequence: Run tagging sequence
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/app/routes/folders.py`:
- Around line 289-291: Update the done callback attached to index_future in
post_folder_add_sequence to inspect the completed future’s result and queue
_queue_post_index_tagging_sweep(app_state) only when it returns True. Handle
exceptions, cancellation, and False results by logging the failure and returning
without scheduling the tagging sweep, and add coverage for a failed-index
result.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1236a559-e8e5-417f-93a3-1f9f451a286a
📒 Files selected for processing (5)
backend/app/config/settings.pybackend/app/routes/dependencies.pybackend/app/routes/folders.pybackend/main.pybackend/tests/test_folders.py
|
@rohan-pandeyy can you please review this PR. |
|
Please resolve the merge conflicts before review. Your PR will only be reviewed by a maintainer after all conflicts have been resolved. 📺 Watch this video to understand why conflicts occur and how to resolve them: |
|
@rohan-pandeyy can you please review this pr. 🙃 |
Addressed Issues:
Fixes #1436 : Indexing works in series in the application while folder Uploads.
Screenshots/Recordings:
PictoPy Before:
Screen.Recording.2026-08-06.at.10.24.28.AM.mov
PictoPy After:
Screen.Recording.2026-08-06.at.10.25.29.AM.mov
Additional Notes:
Files changed: 5
backend/main.py:
Added a dedicated indexing process pool that is initialized and shut down alongside the existing executor.
app.state.indexing_executor = ProcessPoolExecutor(max_workers=INDEXING_MAX_WORKERS)backend/app/config/settings.py:
Added a configurable
INDEXING_MAX_WORKERSsetting to control the size of the dedicated indexing pool.backend/app/routes/folders.py:
Updated add_folder to submit indexing jobs to the dedicated indexing pool instead of the shared executor.
Added a follow-up tagging sweep that is queued only after folder indexing completes, ensuring images indexed after an earlier tagging pass are not missed.
backend/tests/test_folders.py:
Conclusion:
(Still AI tagging process works in series but it is alright because it is in the need to go through each and every image, and changing it requires a lot of redesigning.)
AI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
I have used the following AI models and tools: Claude Sonnet - 5
Checklist
Summary by CodeRabbit
New Features
Performance
Bug Fixes
Tests