mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#433 use os.clock instead of util.time_s for coordinator connection timeout to supervisor
This commit is contained in:
@ -302,7 +302,7 @@ function coordinator.comms(version, nic, sv_watchdog)
|
|||||||
|
|
||||||
if not self.sv_linked then
|
if not self.sv_linked then
|
||||||
if self.est_tick_waiting == nil then
|
if self.est_tick_waiting == nil then
|
||||||
self.est_start = util.time_s()
|
self.est_start = os.clock()
|
||||||
self.est_last = self.est_start
|
self.est_last = self.est_start
|
||||||
|
|
||||||
self.est_tick_waiting, self.est_task_done =
|
self.est_tick_waiting, self.est_task_done =
|
||||||
@ -310,10 +310,10 @@ function coordinator.comms(version, nic, sv_watchdog)
|
|||||||
|
|
||||||
_send_establish()
|
_send_establish()
|
||||||
else
|
else
|
||||||
self.est_tick_waiting(math.max(0, LINK_TIMEOUT - (util.time_s() - self.est_start)))
|
self.est_tick_waiting(math.max(0, LINK_TIMEOUT - (os.clock() - self.est_start)))
|
||||||
end
|
end
|
||||||
|
|
||||||
if abort or (util.time_s() - self.est_start) >= LINK_TIMEOUT then
|
if abort or (os.clock() - self.est_start) >= LINK_TIMEOUT then
|
||||||
self.est_task_done(false)
|
self.est_task_done(false)
|
||||||
|
|
||||||
if abort then
|
if abort then
|
||||||
@ -336,9 +336,9 @@ function coordinator.comms(version, nic, sv_watchdog)
|
|||||||
elseif self.sv_config_err then
|
elseif self.sv_config_err then
|
||||||
coordinator.log_comms("supervisor unit count does not match coordinator unit count, check configs")
|
coordinator.log_comms("supervisor unit count does not match coordinator unit count, check configs")
|
||||||
ok = false
|
ok = false
|
||||||
elseif (util.time_s() - self.est_last) > 1.0 then
|
elseif (os.clock() - self.est_last) > 1.0 then
|
||||||
_send_establish()
|
_send_establish()
|
||||||
self.est_last = util.time_s()
|
self.est_last = os.clock()
|
||||||
end
|
end
|
||||||
elseif self.est_tick_waiting ~= nil then
|
elseif self.est_tick_waiting ~= nil then
|
||||||
self.est_task_done(true)
|
self.est_task_done(true)
|
||||||
|
@ -22,7 +22,7 @@ local sounder = require("coordinator.sounder")
|
|||||||
|
|
||||||
local apisessions = require("coordinator.session.apisessions")
|
local apisessions = require("coordinator.session.apisessions")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "v1.2.5"
|
local COORDINATOR_VERSION = "v1.2.6"
|
||||||
|
|
||||||
local println = util.println
|
local println = util.println
|
||||||
local println_ts = util.println_ts
|
local println_ts = util.println_ts
|
||||||
|
Reference in New Issue
Block a user