Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this implement/fix?
Improve database updating procedure by avoiding opening a dedicated / separate database connection for updating the query counters when we already have the disk database attached to our in-memory database under the
disk.*
namespace. This also brings a bit of code duplication and removal of functions called only once.I noticed this in it in this - otherwise unrelated - Discourse topic:
https://discourse.pi-hole.net/t/pihole-v6-on-low-spec-hardware/72442/5?u=dl6er
where we're seeing
which is unnecessary here. This PR is also a performance improvement, even when this is not immediately relevant for DNS operation, it is still meaningful as the on-disk database will be blocked for a bit less of time.
This PR also fixes a small bug which adds too many queries to the database counters.
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:
git rebase
)Checklist:
developmental
branch.