diff --git a/src/usr/local/emhttp/plugins/tailscale/include/daily/ping.php b/src/usr/local/emhttp/plugins/tailscale/include/daily/ping.php index ba0ec27..9310c6c 100755 --- a/src/usr/local/emhttp/plugins/tailscale/include/daily/ping.php +++ b/src/usr/local/emhttp/plugins/tailscale/include/daily/ping.php @@ -65,15 +65,16 @@ function send_usage($url, $content) 'bool5' => $exit ); - logmsg("Sending usage data"); $attempts = 0; - $delay = 0; + $delay = rand(0, 300); do { - sleep(rand($delay, $delay + 60)); - $delay = 300; - + logmsg("Waiting for {$delay} seconds before sending usage data."); + sleep($delay); + $delay += 300; $attempts++; + $result = send_usage($endpoint, $content); + logmsg("Usage data sent."); } while (($result != '200') && ($attempts < 3)); if ($result != '200') {