Commits

Ronny Pfannschmidt  committed 500ee1d

correctly save versions of steps instead of causing batch conflicts

  • Participants
  • Parent commits 37bd4f9

Comments (0)

Files changed (3)

File glas_process/baseproc.py

     def save_with_batch(self, doc):
         self.procdir.save_with_batch(doc)
 
+    def save_step(self):
+        self.procdir.db.save_doc(self.step)
 
     def __init__(self, procdir, step):
         self.procdir = procdir
         self.greenlets = []
         self._control = None
         self.step = step
-        self.save_with_batch(step)
+        self.save_step()
 
     def spawn(self, func, *k, **kw):
         res = gevent.spawn(func, *k,  **kw)
             if returncode is not None and self.step is not None:
                 status = 'complete' if returncode == 0 else 'failed'
                 self.step.status = status
-                self.save_with_batch(self.step)
+                self.save_step()
 
     def start(self):
         if self._control is None:

File glas_process/subprocess.py

 
     def create(self):
         self.step.status = 'running'
-        self.save_with_batch(self.step)
+        self.save_step()
         self.popen = start_subprocess(self)
 
 

File testing/test_events.py

 def pytest_funcarg__procdir(request):
     procdir = request.getfuncargvalue('procdir')
     procdir._events = []
-    def save(doc):
+    def save(doc, **kw):
         newdoc = type(doc).wrap(copy.deepcopy(doc.to_json()))
         procdir._events.append(newdoc)
-        type(procdir).save_with_batch(procdir, doc)
-    procdir.save_with_batch = save
+        type(procdir.db).save_doc(procdir.db, doc, **kw)
+    procdir.db.save_doc = save
     return procdir