Repository navigation
fix: stop the duplicate scan from fetching every listed post - #90
Merged
Merged
Conversation
Reading a field a listed post lacks (crosspost_parent_list) made PRAW fetch the post, one request per post, and the scan hit HTTP 429. Read fields from what the listing returned, and keep a Phase 3 entry for the next run instead of crashing when Reddit rate limits or fails. Co-Authored-By: Toldry <toldry@gmail.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXeu2v7gGePkS9NhaCgwDy
Toldry
added a commit
that referenced
this pull request
Oct 16, 2026
Co-Authored-By: Toldry <toldry@gmail.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bi2vprJUUCtGDcGHxadEba
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Querent · project thread
Before: on v2.14.3,
docker compose exec bot python -m racb --process-onecrashed during the image duplicate scan withprawcore.exceptions.TooManyRequests: received 429 HTTP response. #89 made the scan readcrosspost_parent_listand similar fields. Most listed posts don't have them, and when code reads a field a listed post lacks, PRAW downloads the whole post again. That was one request per post, up to about 1000 in a full scan.After: the scan reads media fields only from what the listing already returned (
duplicate_detector.post_attribute), so classifying listed posts makes no requests. A post known only by its id, like a comment'ssubmission, is fetched once. Separately, a rate limit or network error while Phase 3 handles an entry no longer crashes--process-oneor aborts the scheduled job with a traceback. It logs a warning, keeps the row for the next run, and stops the batch.How:
post_attributereadsvars(post)for PRAW objects.TRANSIENT_NETWORK_ERRORSmoved frommain.pytoracb.core.redditso Phase 3 can use it.phase3.handle_comment_or_deferwrapshandle_comment. The new unit test builds real PRAWSubmissions as a listing creates them, with_fetchpatched to fail. It fails on master and passes here.🤖 Generated with Claude Code
https://claude.ai/code/session_01PXeu2v7gGePkS9NhaCgwDy
Generated by Claude Code