Re-added delay to eww network script for tycho
This commit is contained in:
@@ -225,13 +225,13 @@ while True:
|
|||||||
hop = get_first_hop()
|
hop = get_first_hop()
|
||||||
gw = get_gateways()
|
gw = get_gateways()
|
||||||
default_route = get_default_route()
|
default_route = get_default_route()
|
||||||
# public IP shouldn't change often, so only check every 30 minutes or
|
# public IP shouldn't change often, so only check every 2 hours or
|
||||||
# if the default route or first hop changes
|
# if the default route or first hop changes
|
||||||
if (
|
if (
|
||||||
default_route != last_default_route
|
default_route != last_default_route
|
||||||
or last_ip_data is None
|
or last_ip_data is None
|
||||||
or last_request is None
|
or last_request is None
|
||||||
or now() - last_request > 1800
|
or now() - last_request > (2 * 60 * 60)
|
||||||
or (hop != last_first_hop and hop is not None)
|
or (hop != last_first_hop and hop is not None)
|
||||||
):
|
):
|
||||||
print("refreshing public IP", file=sys.stderr, flush=True)
|
print("refreshing public IP", file=sys.stderr, flush=True)
|
||||||
@@ -277,3 +277,5 @@ while True:
|
|||||||
),
|
),
|
||||||
flush=True,
|
flush=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
sleep(5)
|
||||||
|
|||||||
Reference in New Issue
Block a user