def reset_dispatch(self, pk): try: ds1 = dispatcher_status.objects.get(pk=pk) if ds1.status == 'Reset': ds1.status = 'Stopped' ds1.job_name = '' ds1.save() print('save') except dispatcher_status.DoesNotExist: ds1 = dispatcher_status.objects.all().delete() ds1 = dispatcher_status(status = 'Stopped') ds1.id = 1 ds1.save()
def reset_dispatch(self, pk): try: ds1 = dispatcher_status.objects.get(pk=pk) if ds1.status == 'Reset': ds1.status = 'Stopped' ds1.job_name = '' ds1.save() print('save') except dispatcher_status.DoesNotExist: ds1 = dispatcher_status.objects.all().delete() ds1 = dispatcher_status(status='Stopped') ds1.id = 1 ds1.save()
def get_job_object(self, pk): try: ds1 = dispatcher_status.objects.get(pk=pk) if ds1.status == 'Reset': ds1.status = 'Stopped' ds1.job_name = '' ds1.save() return ds1 except: ds1 = dispatcher_status.objects.all().delete() ds1 = dispatcher_status(status='Stopped') ds1.id = 1 ds1.save() return ds1
def get_job_object(self, pk): try: ds1 = dispatcher_status.objects.get(pk=pk) if ds1.status == 'Reset': ds1.status = 'Stopped' ds1.job_name = '' ds1.save() return ds1 except: ds1 = dispatcher_status.objects.all().delete() ds1 = dispatcher_status(status = 'Stopped') ds1.id = 1 ds1.save() return ds1
def set_object(self): try: ds1 = dispatcher_status.objects.get(pk=1) if ds1.status != 'Reset': ds1.status = 'Reset' ds1.save() except: ds1 = dispatcher_status.objects.all().delete() ds1 = dispatcher_status(status='Reset') ds1.id = 1 ds1.save() try: sj1 = Simulation_Job.objects.get(status='running') sj1.status = 'aborted' sj1.save() except: pass return
def set_object(self): try: ds1 = dispatcher_status.objects.get(pk=1) if ds1.status != 'Reset': ds1.status = 'Reset' ds1.save() except: ds1 = dispatcher_status.objects.all().delete() ds1 = dispatcher_status(status = 'Reset') ds1.id = 1 ds1.save() try: sj1 = Simulation_Job.objects.get(status='running') sj1.status ='aborted' sj1.save() except: pass return
job_script2 = 'Job_Dispatcher2.py' analyze_script = 'Texas_Holdem_AnalyzeStats.py' sim_dir = root_dir + app_dir + sim_script_dir try: ds1 = dispatcher_status.objects.get(pk=1) if ds1.status == 'Reset': ds1.status = 'Stopped' ds1.job_name = '' ds1.save() print('save') except dispatcher_status.DoesNotExist: ds1 = dispatcher_status.objects.all().delete() ds1 = dispatcher_status(status='Stopped') dsd = ds1.id ds1.id = 1 ds1.save() class index(APIView): def reset_dispatch(self, pk): try: ds1 = dispatcher_status.objects.get(pk=pk) if ds1.status == 'Reset': ds1.status = 'Stopped' ds1.job_name = '' ds1.save() print('save') except dispatcher_status.DoesNotExist:
job_script2 = 'Job_Dispatcher2.py' analyze_script = 'Texas_Holdem_AnalyzeStats.py' sim_dir = root_dir + app_dir + sim_script_dir try: ds1 = dispatcher_status.objects.get(pk=1) if ds1.status == 'Reset': ds1.status = 'Stopped' ds1.job_name = '' ds1.save() print('save') except dispatcher_status.DoesNotExist: ds1 = dispatcher_status.objects.all().delete() ds1 = dispatcher_status(status = 'Stopped') dsd = ds1.id ds1.id = 1 ds1.save() class index(APIView): def reset_dispatch(self, pk): try: ds1 = dispatcher_status.objects.get(pk=pk) if ds1.status == 'Reset': ds1.status = 'Stopped' ds1.job_name = '' ds1.save() print('save') except dispatcher_status.DoesNotExist: