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

fix(filters): max downloads per hour check #514

Merged
merged 2 commits into from
Oct 27, 2022

Conversation

zze0s
Copy link
Collaborator

@zze0s zze0s commented Oct 27, 2022

This PR fixes the check for download per HOUR on SQLite.

The solution is quite obvious now, but wasn't at the time. timestamp >= strftime('%Y-%m-%dT%H:00:00Z', datetime('now','localtime')).

That basically transforms the current time into a fixed format, and set's the current hour %H to the current hour from datetime, in local timezone, and then hardcodes minute and seconds to 00:00. So no more rolling hour, and there shouldn't be any bugs with it letting through more than set.

Day, week, month and total has been working fine all the time.

Fixes #467 #455

@zze0s zze0s added backend Backend bug Something isn't working filters Filters releases labels Oct 27, 2022
@zze0s zze0s linked an issue Oct 27, 2022 that may be closed by this pull request
@zze0s zze0s merged commit 716784e into develop Oct 27, 2022
@zze0s zze0s deleted the fix/filters-max-downloads-hour branch October 27, 2022 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend bug Something isn't working filters Filters releases
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Max downloads per X buggy Max Downloads Limits Fail for Generic RSS
1 participant