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 1 day offset for top list range #162

Merged
merged 1 commit into from
Jun 15, 2020
Merged

Conversation

stklcode
Copy link
Contributor

Top lists are either generated for "today" or for the whole display range.

The underlying query however returns one day more than expected, if storage range is greater display range.

... WHERE created >= DATE_SUB(%s, INTERVAL %d DAY)

obviously fetches data of "x days ago" inclusive which makes x+1 days with today, so one more than expected.

The visit query is not affected because it uses LIMIT %d in the aggregation query and the Cron cleanup uses created <= DATE_SUB(...) so it's done right there.

@stklcode stklcode added the bug label Jun 10, 2020
Top lists are either generated for "today" or for the whole display
range. The underlying query however returns one day more than expected,
if storage range is greater display range.
@stklcode stklcode force-pushed the fix/top-list-offset branch from fa13bd1 to c6896d6 Compare June 10, 2020 13:38
@stklcode stklcode added this to the 1.7.2 milestone Jun 10, 2020
@patrickrobrecht patrickrobrecht merged commit 8b14039 into master Jun 15, 2020
@patrickrobrecht patrickrobrecht deleted the fix/top-list-offset branch June 15, 2020 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants