#589 cleanup and fixes

This commit is contained in:
Mikayla Fischler 2025-02-09 14:19:06 -05:00
parent ecdaf78ed0
commit 5f22069ce1
4 changed files with 7 additions and 7 deletions

View File

@ -364,9 +364,9 @@ function facility.new(config)
end end
end end
-- initialize startup recovery -- initialize facility resume boot recovery
---@param state sv_boot_state|nil ---@param state sv_boot_state|nil
function public.startup_recovery_init(state) function public.boot_recovery_init(state)
if self.recovery == RCV_STATE.INACTIVE and state then if self.recovery == RCV_STATE.INACTIVE and state then
self.recovery_boot_state = state self.recovery_boot_state = state
self.recovery = RCV_STATE.PRIMED self.recovery = RCV_STATE.PRIMED
@ -374,9 +374,9 @@ function facility.new(config)
end end
end end
-- attempt startup recovery -- attempt facility resume boot recovery
---@param auto_cfg start_auto_config configuration ---@param auto_cfg start_auto_config configuration
function public.startup_recovery_start(auto_cfg) function public.boot_recovery_start(auto_cfg)
if self.recovery == RCV_STATE.PRIMED then if self.recovery == RCV_STATE.PRIMED then
self.recovery = util.trinary(_auto_check_and_save(auto_cfg), RCV_STATE.RUNNING, RCV_STATE.STOPPED) self.recovery = util.trinary(_auto_check_and_save(auto_cfg), RCV_STATE.RUNNING, RCV_STATE.STOPPED)
log.info(util.c("FAC: startup resume ", util.trinary(self.recovery == RCV_STATE.RUNNING, "started", "failed"))) log.info(util.c("FAC: startup resume ", util.trinary(self.recovery == RCV_STATE.RUNNING, "started", "failed")))

View File

@ -145,7 +145,7 @@ function update.boot_recovery()
-- try to start auto control -- try to start auto control
if self.recovery_boot_state.mode ~= nil and self.units_ready then if self.recovery_boot_state.mode ~= nil and self.units_ready then
if was_inactive then if not was_inactive then
self.mode = self.mode_set self.mode = self.mode_set
log.info("FAC: process startup resume initiated") log.info("FAC: process startup resume initiated")
end end

View File

@ -247,7 +247,7 @@ function coordinator.new_session(id, s_addr, i_seq_num, in_queue, out_queue, tim
limits = pkt.data[5] limits = pkt.data[5]
} }
facility.startup_recovery_start(config) facility.boot_recovery_start(config)
else else
log.debug(log_tag .. "CRDN process ready packet length mismatch") log.debug(log_tag .. "CRDN process ready packet length mismatch")
end end

View File

@ -148,7 +148,7 @@ local function main()
local heartbeat_toggle = true local heartbeat_toggle = true
-- init startup recovery -- init startup recovery
sv_facility.startup_recovery_init(supervisor.boot_state) sv_facility.boot_recovery_init(supervisor.boot_state)
-- event loop -- event loop
while true do while true do