From 75b587e69390497807d8454f28c2b948e86c8cd8 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch <p.jentsch@uni-bielefeld.de>
Date: Wed, 7 Aug 2019 16:03:24 +0200
Subject: [PATCH] Remove redundant add to session.

---
 app/swarm.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/app/swarm.py b/app/swarm.py
index b870b27a..c9f169dc 100644
--- a/app/swarm.py
+++ b/app/swarm.py
@@ -101,8 +101,8 @@ class Swarm:
         ' Poll the service until the job is completly executed.
         '''
         session = self.Session()
-        job.status = 'running'
         session.add(job)
+        job.status = 'running'
         session.commit()
         current_state = None
         while True:
@@ -112,7 +112,6 @@ class Swarm:
             time.sleep(1)
             service.reload()
         job.status = current_state
-        session.add(job)
         session.commit()
         session.close()
         # Remove the service from the swarm.
-- 
GitLab