aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--global-functions8
1 files changed, 8 insertions, 0 deletions
diff --git a/global-functions b/global-functions
index cfec740..8d44957 100644
--- a/global-functions
+++ b/global-functions
@@ -481,10 +481,17 @@
# check if system time is sync
:set IsTimeSync do={
+ :global IsTimeSyncCached;
+
:global LogPrintExit2;
+ :if ($IsTimeSyncCached = true) do={
+ :return true;
+ }
+
:if ([ /system/ntp/client/get enabled ] = true) do={
:if ([ /system/ntp/client/get status ] = "synchronized") do={
+ :set IsTimeSyncCached true;
:return true;
}
:return false;
@@ -492,6 +499,7 @@
:if ([ /ip/cloud/get update-time ] = true) do={
:if ([ :typeof [ /ip/cloud/get public-address ] ] = "ip") do={
+ :set IsTimeSyncCached true;
:return true;
}
:return false;