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

count is not coming correct in log in truncate_querylogs #636

Closed
fearless0307 opened this issue Jul 3, 2024 · 1 comment · Fixed by #637
Closed

count is not coming correct in log in truncate_querylogs #636

fearless0307 opened this issue Jul 3, 2024 · 1 comment · Fixed by #637

Comments

@fearless0307
Copy link
Contributor

Hi,

in explorer.tasks.snapshot_queries func, inside logger, it's written as

logger.info(
    f"Deleting {qs.count} QueryLog objects older than {days} days."
)

Code link

Which results in log output as.
Deleting <bound method QuerySet.count of <QuerySet [<QueryLog: QueryLog object (2585296)>, <QueryLog: QueryLog object (2585295)>, <QueryLog: QueryLog object (2585294)>, <QueryLog: QueryLog object (2585293)>, <QueryLog: QueryLog object (2585292)>, <QueryLog: QueryLog object (2585291)>, <QueryLog: QueryLog object (2585290)>, <QueryLog: QueryLog object (2585289)>, <QueryLog: QueryLog object (2585288)>, <QueryLog: QueryLog object (2585287)>, <QueryLog: QueryLog object (2585286)>, <QueryLog: QueryLog object (2585285)>, <QueryLog: QueryLog object (2585284)>, <QueryLog: QueryLog object (2585283)>, <QueryLog: QueryLog object (2585282)>, <QueryLog: QueryLog object (2585281)>, <QueryLog: QueryLog object (2585280)>, <QueryLog: QueryLog object (2585279)>, <QueryLog: QueryLog object (2585278)>, <QueryLog: QueryLog object (2585277)>, '...(remaining elements truncated)...']>> QueryLog objects older than 60 days.

I assume that the log output should be as,
Deleting 100 QueryLog objects older than 90 days.
assuming count as 100, days as 90.

Is my assumption correct? if yes, can I add the fix?

Thanks,
Bhola

@chrisclark
Copy link
Collaborator

You are correct! Yes please open a PR for the fix (or I can just fix it myself -- just let me know). Thanks!

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 a pull request may close this issue.

2 participants