Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Bypass database on _since redirect #209

Merged
merged 4 commits into from
Sep 28, 2020

Conversation

leplatrem
Copy link
Contributor

In #205 we decided to redirect clients coming in with an old _since value, in order to preserve our server resources.

This PR is a follow-up that makes sure we bypass the database (should have been the case if the author of #205 would have been more thorough)

@smarnach r?

Copy link

@smarnach smarnach left a comment

Choose a reason for hiding this comment

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

Looks good to me, at least with my limited knowledge of Pyramid and this codebase. :)

# we want to bypass storage).
qs_since_str = request.GET.get("_since", "")
qs_since = int(qs_since_str.strip('"'))
except (TypeError, ValueError):

Choose a reason for hiding this comment

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

We probably don't need TypeError here, but it doesn't hurt eithter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, we would have needed it if qs_since_str could have been None. I'll remove it

@leplatrem leplatrem merged commit ca7c915 into master Sep 28, 2020
@leplatrem leplatrem deleted the bypass-database-on-since-redirect branch September 28, 2020 19:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants