浏览代码

:bug: 添加定时请求 sntp 同步时间来保活, 尝试修复待机一段时间后请求发送失败

Mizore 1 年之前
父节点
当前提交
6090a65fb5
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      script/main.lua

+ 3 - 0
script/main.lua

@@ -118,6 +118,9 @@ sys.taskInit(function()
     -- 开机通知
     if config.BOOT_NOTIFY then sys.timerStart(util_notify.add, 1000 * 5, "#BOOT") end
 
+    -- 定时同步时间
+    sys.timerLoopStart(socket.sntp, 1000 * 60 * 30)
+
     -- 定时查询流量
     if config.QUERY_TRAFFIC_INTERVAL and config.QUERY_TRAFFIC_INTERVAL >= 1000 * 60 then
         sys.timerLoopStart(util_mobile.queryTraffic, config.QUERY_TRAFFIC_INTERVAL)