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

Don't retry 410, move event processing into reusable method #125

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hancush
Copy link
Collaborator

@hancush hancush commented Jan 30, 2025

This PR updates accept_response to prevent retries of requests with the 410 - Gone status code. It also breaks the event processing into its own method so it can be used in a loop or on a standalone event.

@hancush hancush changed the title Don't retry 410, allow search results to be passed to APIEventScraper.events Don't retry 410, move event processing into reusable method Jan 30, 2025
event_url = '{0}/events/{1}'.format(self.BASE_URL, api_event['EventId'])
self.logger.error('API event has invalid start time "{0}": {1}'.format(time_str, event_url))
continue
def event(self, api_event):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separated into its own method, just a whitespace (indentation) change.

@hancush hancush requested a review from antidipyramid January 30, 2025 22:58
@hancush hancush marked this pull request as ready for review January 30, 2025 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant