Remove redundant add to session.

This commit is contained in:
Patrick Jentsch 2019-08-07 16:03:24 +02:00
parent c291fac22f
commit 75b587e693

View File

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