Beispiel #1
0
 def get_job_object(self, pk):
     try:
         ds1 = dispatcher_status2.objects.get(pk=pk)
         if ds1.status == 'Reset':
             ds1.status = 'Stopped'
             ds1.job_name = ''
             ds1.save()
         return ds1
     except:
         ds1 = dispatcher_status2.objects.all().delete()
         ds1 = dispatcher_status2(status='Stopped')
         ds1.id = 1
         ds1.save()
         return ds1
Beispiel #2
0
 def get_job_object(self, pk):
     try:
         ds1 = dispatcher_status2.objects.get(pk=pk)
         if ds1.status == 'Reset':
             ds1.status = 'Stopped'
             ds1.job_name = ''
             ds1.save()           
         return ds1
     except:
         ds1 = dispatcher_status2.objects.all().delete()
         ds1 = dispatcher_status2(status = 'Stopped')
         ds1.id = 1
         ds1.save()
         return ds1
Beispiel #3
0
 def set_object(self):
     try:
         ds1 = dispatcher_status2.objects.get(pk=1)
         if ds1.status != 'Reset':
             ds1.status = 'Reset'
             ds1.save()
     except:
         ds1 = dispatcher_status2.objects.all().delete()
         ds1 = dispatcher_status2(status='Reset')
         ds1.id = 1
         ds1.save()
     try:
         sj1 = analyzed_jobs.objects.get(status='running')
         sj1.status = 'aborted'
         sj1.save()
     except:
         pass
     return
Beispiel #4
0
 def set_object(self):
     try:
         ds1 = dispatcher_status2.objects.get(pk=1)
         if ds1.status != 'Reset':
             ds1.status = 'Reset'
             ds1.save()
     except:
         ds1 = dispatcher_status2.objects.all().delete()
         ds1 = dispatcher_status2(status = 'Reset')
         ds1.id = 1
         ds1.save()      
     try:
         sj1 = analyzed_jobs.objects.get(status='running')
         sj1.status ='aborted'
         sj1.save()
     except:
         pass
     return