Added recording of main process events to persistent storage

This commit is contained in:
Nathan Schneider
2021-12-25 18:01:37 -07:00
parent 6d81bd7bd8
commit c017b80063

View File

@ -49,11 +49,16 @@ function modpol.orgs:call_module(module_slug, initiator, config, result)
self.processes[index] = new_process
self.processes[index]:initiate(result)
local msg = "Initiating "..module_slug..
" process id "..index.." in org "..self.name
return index
end
function modpol.orgs:delete_process(id)
local msg = "Deleting "..self.processes[id].slug..
" process id "..id.." in org "..self.name
self:record(msg, self.processes[id].slug)
self:wipe_pending_actions(id)
self.processes[id] = 'deleted'
end
@ -97,6 +102,10 @@ function modpol.orgs:interact(process_id, user)
local callback = self.pending[user][process_id]
if callback then
process[callback](process, user)
-- record org data
local msg = "Updating "..self.processes[process_id].slug..
" process id "..process_id.." in org "..self.name
self:record(msg, self.processes[process_id].slug)
end
end
end