Minor fixes

This commit is contained in:
gSpot
2024-01-28 18:46:58 +03:00
parent 9364dabe0a
commit b5a4429854

View File

@@ -347,9 +347,9 @@ function InternetDetector:main()
signal.signal(signal.SIGUSR1, function(signo) self:resetUiCounter(signo) end) signal.signal(signal.SIGUSR1, function(signo) self:resetUiCounter(signo) end)
local lastStatus, currentStatus, mTimeNow, mTimeDiff, mLastTime, uiTimeNow, uiLastTime local lastStatus, currentStatus, mTimeNow, mTimeDiff, mLastTime, uiTimeNow, uiLastTime
local interval = self.serviceConfig.interval_up local interval = self.serviceConfig.interval_up
local counter = 0 local counter = 0
local onStart = true local onStart = true
RUNNING = true RUNNING = true
while RUNNING do while RUNNING do
if counter == 0 or counter >= interval then if counter == 0 or counter >= interval then
@@ -441,12 +441,6 @@ function InternetDetector:status()
return "stoped" return "stoped"
end end
function InternetDetector:poll()
local retCode = self:checkHosts()
return string.format('{"instances":[%s]}', self:statusJson(
retCode, self.serviceConfig.instance))
end
function InternetDetector:inetStatus() function InternetDetector:inetStatus()
local inetStat = '{"instances":[]}' local inetStat = '{"instances":[]}'
local ok, commonDir = pcall(dirent.files, self.commonDir) local ok, commonDir = pcall(dirent.files, self.commonDir)