fix: 改进重启逻辑以支持os.reboot回退方案

当os.reboot可用时优先使用,否则回退到shutdown函数,确保重启功能更可靠
This commit is contained in:
2025-09-01 17:52:56 +08:00
parent 1bf9e1c914
commit 2016bef5c4

View File

@@ -56,7 +56,13 @@ function rc.shutdown()
end end
function rc.reboot() function rc.reboot()
reboot() -- Try to use os.reboot if available
if os.reboot then
os.reboot()
else
-- Fallback to shutdown if reboot isn't available
shutdown()
end
while true do coroutine.yield() end while true do coroutine.yield() end
end end
local timer_filter = {} local timer_filter = {}