Skip to content

Commit

Permalink
Update daily_speedtest.py
Browse files Browse the repository at this point in the history
  • Loading branch information
phate999 authored Apr 16, 2024
1 parent c3ccb8d commit 2ecfcbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions daily_speedtest/daily_speedtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def run_speedtest():
cp.log(f'Daily speedtest hours: {testing_hours} -- Running now...')
wan = cp.get('status/wan/primary_device')
wan_ip = cp.get(f'status/wan/devices/{wan}/status/ipinfo/ip_address')
speedtest = Speedtest(source_address=wan_ip)
speedtest = Speedtest()
speedtest.get_best_server()
speedtest.download()
speedtest.upload(pre_allocate=False)
Expand Down Expand Up @@ -57,8 +57,8 @@ def run_speedtest():
for testing_hour in testing_hours:
if not last_test_dates.get(testing_hour):
last_test_dates[testing_hour] = None
if last_test_dates[testing_hour] != datetime.now().today():
if last_test_dates[testing_hour] != datetime.today().date():
if testing_hour == datetime.now().today().hour:
run_speedtest()
last_test_dates[testing_hour] = datetime.now().today()
last_test_dates[testing_hour] = datetime.today().date()
time.sleep(60)

0 comments on commit 2ecfcbe

Please sign in to comment.