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

Always store time we start saving to the database #1514

Merged
merged 1 commit into from
Dec 27, 2022

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Dec 27, 2022

What does this implement/fix?

Always store time we start to save to the database (not only in debug mode). This avoids erroneous timing reports in case of errors like seen here:

[2022-12-26 11:29:00.102 1204/T1220] Notice: Queries stored in long-term database: 166 (took 1672072140102.7 ms, last SQLite ID 4461823)

This bug has no other consequences else than the wrongly logged time.

Related issue or feature (if applicable): N/A

**Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

… mode). This avoids errorneous timing reports in case of errors.

Signed-off-by: DL6ER <[email protected]>
@DL6ER DL6ER added the Bugfix label Dec 27, 2022
@DL6ER DL6ER requested review from rdwebdesign and a team December 27, 2022 06:35
Copy link
Member

@PromoFaux PromoFaux left a comment

Choose a reason for hiding this comment

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

Yep, logic seems sound. Without calling timer_start, I guess DATABASE_WRITE_TIMER defaults to 1970-01-01 00:00:00.000, and so the ms difference is between now and then.

@DL6ER DL6ER merged commit 928fe82 into development Dec 27, 2022
@DL6ER DL6ER deleted the fix/query_store_message branch December 27, 2022 17:16
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-20-1-web-v5-18-1-and-core-v5-15-released/60495/1

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.

4 participants