Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: Add context deadline error handling #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

henro47
Copy link

@henro47 henro47 commented Jul 30, 2024

On a project that I recently worked on I had an issue where sometimes the site I was scraping became unresponsive while downloading files.

This PR adds a select to handle the context deadline exceeded and safely stop the execution of the program.

We scrape certain websites on a daily basis via a reflex event queue Finite state machine.
The file download section I edited in this PR "blocked" the queue and completely stopped processing events.
I had to manually restart our instance each time to get the downloads to finish. This change I implemented sorted out my issue and will hopefully help anyone else in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant