fix: replace fixed 3s sleep with load event + 0.5s in get_md - #25
Merged
Conversation
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.
wait_until="commit"+asyncio.sleep(3)was fragile — slow pages could still be loading, fast pages wasted time.Switching to
wait_until="load"(waits for HTML/CSS/images) + a 0.5s sleep for JS rendering. Most research sources are server-rendered so 0.5s is sufficient.Also adds
*.ipynbto.gitignore.Closes #4
Greptile Summary
Improved page loading reliability in
get_md()by switching fromwait_until="commit"towait_until="load"and reducing sleep time from 3s to 0.5s.wait_until="load"waits for HTML/CSS/images before proceeding (more robust than"commit")*.ipynbto.gitignorefor local notebook experimentsConfidence Score: 5/5
wait_until="load"is more robust than the previous"commit"approach, and the reduced sleep time (0.5s vs 3s) is appropriate for the stated use case of server-rendered pages. The.gitignoreaddition is standard practice. No logic, syntax, or security issues detected.Important Files Changed
*.ipynbto ignore Jupyter notebooks - standard practicewait_until="load"+ 0.5s for JS rendering - more reliable and efficientLast reviewed commit: 8d728c1