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 PR aim to accomplish?:
This PR solves more than one, but connected issues.
PADD
has fiveGetXXXInformation
routines which were executed every 5 seconds. One of them had a check (GetVersionInformation
) that the function is only executed once a day by writingtoday
into thepiHoleVersion_file
and checking that date against now. On every startup or after a date change the file was deleted to update the information.All other
GetXXXInformation
routines did not have such a check. But some of those gathered information are unlikely to update every 5 seconds, e.g.hostname
,IPv4
address,DNSSEC status
, etc.To allow setting individual polling times, each
GetXXXInformation
routine is now wrapped in a checker, which checks that last execution time is more than xx seconds in the past.This also allows us to get rid of the
piHoleVersion_file
which was basically used to hold a timestamp and some information for re-use.Additionally, this PR
fixes a bug which was introduced by 06fe88f where
setupVars.conf
was only sourced at the beginning of the script. However, we need to source repeatedly to check if settings (likeDNSSEC
status) have changedadded
GetPiholeInformation
to the startup routine for${padd_size}=mini
. This was likely forgotten a long time ago alreadymoves the
sleep 5
above the execution of theGetXXXInformation
routines which allows to display "non-stale" (5 sec old) dataadds a few missing "size"_status, see PR update status of mega screen size #144 for one of them
How does this PR accomplish the above?:
Add individual timers for each check. Remove now unused
piHoleVersion_file
P.S. Comparison on GH looks worse than in reality. Most are indention changes in
GetVersionInformation
By submitting this pull request, I confirm the following:
git rebase
)