Commit 6485992a authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

Fix bug in update running jobs

parent e70e6260
......@@ -15,7 +15,7 @@ class Service:
finished = jobs.get('finished')
if finished:
for i in finished:
Job.objects.filter(job_uuid=i['id']).update(status='FIN', end_time=i['end_time'])
Job.objects.filter(job_uuid=i['id'], status='RUN').update(status='FIN', end_time=i['end_time'])
except:
pass
......
......@@ -16,6 +16,7 @@ class JobListView(ListView):
super(JobListView, self).__init__()
def get(self, request, *args, **kwargs):
self.service.update_jobs_status()
j = Job.objects.all().order_by('-create_time')
print("NOOOOOT")
if request.is_ajax():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment