@@ -19,7 +19,7 except ImportError: | |||
|
19 | 19 | from .forms import CampaignForm, ExperimentForm, DeviceForm, ConfigurationForm, LocationForm, UploadFileForm, DownloadFileForm, OperationForm, NewForm |
|
20 | 20 | from .forms import OperationSearchForm, FilterForm, ChangeIpForm |
|
21 | 21 | |
|
22 | from .tasks import task_start, task_stop | |
|
22 | from .tasks import task_start, task_stop, task_status | |
|
23 | 23 | |
|
24 | 24 | from apps.rc.forms import RCConfigurationForm, RCLineCode, RCMixConfigurationForm |
|
25 | 25 | from apps.dds.forms import DDSConfigurationForm |
@@ -737,10 +737,12 def experiment_start(request, id_exp): | |||
|
737 | 737 | else: |
|
738 | 738 | task = task_start.delay(exp.pk) |
|
739 | 739 | exp.status = task.wait() |
|
740 | ||
|
740 | 741 | if exp.status==0: |
|
741 | 742 | messages.error(request, 'Experiment {} not start'.format(exp)) |
|
742 | 743 | if exp.status==2: |
|
743 | 744 | messages.success(request, 'Experiment {} started'.format(exp)) |
|
745 | task_status.delay(exp.pk) #background get_status function | |
|
744 | 746 | exp.save() |
|
745 | 747 | |
|
746 | 748 | return redirect(exp.get_absolute_url()) |
@@ -756,7 +758,7 def experiment_stop(request, id_exp): | |||
|
756 | 758 | return redirect(exp.get_absolute_url()) |
|
757 | 759 | |
|
758 | 760 | exp.get_status() |
|
759 | ||
|
761 | ||
|
760 | 762 | if exp.status == 2: |
|
761 | 763 | task = task_stop.delay(exp.pk) |
|
762 | 764 | exp.status = task.wait() |
General Comments 0
You need to be logged in to leave comments.
Login now