Skip to content

Commit

Permalink
throttleEAS
Browse files Browse the repository at this point in the history
  • Loading branch information
SpudGunMan committed Dec 5, 2024
1 parent bc7d47b commit 61c5be1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,12 @@ def handleMultiPing(nodeID=0, deviceID=1):


def handleWxBroadcast(deviceID=1):
# only allow API call every 15 minutes
# only allow API call every 20 minutes
# the watchdog will call this function 3 times, seeing possible throttling on the API
clock = datetime.now()
if clock.minute % 20 == 0:
if clock.minute % 20 != 0:
return False
if clock.second > 17:
return False

# check for alerts
Expand Down

0 comments on commit 61c5be1

Please sign in to comment.