#99 updating/sending builds

This commit is contained in:
Mikayla Fischler
2022-10-02 21:17:13 -04:00
parent 1b553ad495
commit c02479b52e
15 changed files with 148 additions and 75 deletions

View File

@@ -19,6 +19,16 @@ local println_ts = util.println_ts
local INITIAL_WAIT = 1500
local RETRY_PERIOD = 1000
local CRD_S_CMDS = {
RESEND_BUILDS = 1
}
local CRD_S_DATA = {
}
coordinator.CRD_S_CMDS = CRD_S_CMDS
coordinator.CRD_S_DATA = CRD_S_DATA
local PERIODICS = {
KEEP_ALIVE = 2000,
STATUS = 500
@@ -51,11 +61,11 @@ function coordinator.new_session(id, in_queue, out_queue, facility_units)
},
-- when to next retry one of these messages
retry_times = {
builds_packet = (util.time() + 500)
builds_packet = 0
},
-- message acknowledgements
acks = {
builds = true
builds = false
}
}
@@ -227,6 +237,13 @@ function coordinator.new_session(id, in_queue, out_queue, facility_units)
_handle_packet(message.message)
elseif message.qtype == mqueue.TYPE.COMMAND then
-- handle instruction
local cmd = message.message
if cmd == CRD_S_CMDS.RESEND_BUILDS then
-- re-send builds
self.acks.builds = false
self.retry_times.builds_packet = util.time() + RETRY_PERIOD
_send_builds()
end
elseif message.qtype == mqueue.TYPE.DATA then
-- instruction with body
end