Skip to content

Commit

Permalink
Require all API data after connection is re-established
Browse files Browse the repository at this point in the history
Signed-off-by: yubiuser <[email protected]>
  • Loading branch information
yubiuser committed Aug 9, 2024
1 parent 09e3396 commit 0440ade
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions padd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1675,8 +1675,8 @@ NormalPADD() {
Authenticate
fi

# Request PADD data
if [ $((now - LastCheckFullInformation)) -ge 30 ]; then
# Request PADD data after 30 seconds or if the connection was lost
if [ $((now - LastCheckFullInformation)) -ge 30 ] || [ "${connection_down_flag}" = true ] ; then
GetPADDData
LastCheckFullInformation="${now}"
else
Expand All @@ -1693,16 +1693,19 @@ NormalPADD() {
GetPiholeInformation
GetNetworkInformation
GetVersionInformation
# set flag to update network information in the next loop in case the connection is re-established
get_network_information_requried=true
else
# Get uptime, CPU load, temp, etc. every 5 seconds
GetSystemInformation
GetSummaryInformation
GetPiholeInformation

if [ $((now - LastCheckNetworkInformation)) -ge 30 ]; then
if [ $((now - LastCheckNetworkInformation)) -ge 30 ] || [ "${get_network_information_requried}" = true ]; then
GetNetworkInformation
GetVersionInformation
LastCheckNetworkInformation="${now}"
get_network_information_requried=false
fi

# Get PADD version information every 24hours
Expand Down

0 comments on commit 0440ade

Please sign in to comment.