2
0
Эх сурвалжийг харах

Added recording of main process events to persistent storage

Nathan Schneider 2 жил өмнө
parent
commit
c017b80063

+ 9 - 0
modpol_core/orgs/process.lua

@@ -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