]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_core/commitdiff
pcall sntp to dodge panics
authorNathaniel Wesley Filardo <nwfilardo@gmail.com>
Thu, 26 Dec 2019 00:39:16 +0000 (00:39 +0000)
committerNathaniel Wesley Filardo <nwfilardo@gmail.com>
Thu, 26 Dec 2019 00:39:16 +0000 (00:39 +0000)
Since sntp is mostly an autonomic thing, it's perhaps fine to drop these
on the floor.

For example, we might have a sync in progress, which throws.

net/nwfnet-sntp.lua

index 11ef3ee4c41ae005a0180256aa1f00c28453598b..4020665798b5a029662f5ff3648ae59f3ff7a566 100644 (file)
@@ -1,5 +1,5 @@
 local function dosntp(server)
-  sntp.sync((require "nwfnet").sntp,
+  pcall(sntp.sync,(require "nwfnet").sntp,
      function(sec,usec,server) rtctime.set(sec,usec); (require"nwfnet"):runnet("sntpsync",sec,usec,server) end,
      function(err) (require"nwfnet"):runnet("sntperr",err) end
   )