1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
@@ -420,9 +420,10 class ABSConfiguration(Configuration): | |||||
420 | try: |
|
420 | try: | |
421 | data, address = sock.recvfrom(1024) |
|
421 | data, address = sock.recvfrom(1024) | |
422 | print (address, data) |
|
422 | print (address, data) | |
423 |
|
423 | data = data.decode("utf-8") | ||
424 | if data == '1': |
|
424 | if data == '1': | |
425 | status[int(address[0][10:])-1] = '3' |
|
425 | status[int(address[0][10:])-1] = '3' | |
|
426 | #print (int(address[0][10:])-1) | |||
426 | elif data == '0': |
|
427 | elif data == '0': | |
427 | status[int(address[0][10:])-1] = '1' |
|
428 | status[int(address[0][10:])-1] = '1' | |
428 | except socket.timeout: |
|
429 | except socket.timeout: | |
@@ -477,6 +478,7 class ABSConfiguration(Configuration): | |||||
477 | print('Inicia intento de salvar device.status') |
|
478 | print('Inicia intento de salvar device.status') | |
478 | self.device.status = 3 |
|
479 | self.device.status = 3 | |
479 | self.module_status = ''.join(status) |
|
480 | self.module_status = ''.join(status) | |
|
481 | #print(status) | |||
480 | self.save() |
|
482 | self.save() | |
481 | print('Estatus salvado') |
|
483 | print('Estatus salvado') | |
482 | conf_active, __ = ABSActive.objects.get_or_create(pk=1) |
|
484 | conf_active, __ = ABSActive.objects.get_or_create(pk=1) |
@@ -6,6 +6,9 import json | |||||
6 | from datetime import timedelta, datetime |
|
6 | from datetime import timedelta, datetime | |
7 | from celery.task import task |
|
7 | from celery.task import task | |
8 |
|
8 | |||
|
9 | from celery.utils.log import get_task_logger | |||
|
10 | logger = get_task_logger(__name__) | |||
|
11 | ||||
9 | @task(name='task_change_beam') |
|
12 | @task(name='task_change_beam') | |
10 | def task_change_beam(id_conf): |
|
13 | def task_change_beam(id_conf): | |
11 |
|
14 | |||
@@ -37,12 +40,12 def task_change_beam(id_conf): | |||||
37 | abs_conf.send_beam_num(i+1) |
|
40 | abs_conf.send_beam_num(i+1) | |
38 | next_beam.set_as_activebeam() |
|
41 | next_beam.set_as_activebeam() | |
39 | task = task_change_beam.apply_async((abs_conf.pk,), eta=date) |
|
42 | task = task_change_beam.apply_async((abs_conf.pk,), eta=date) | |
40 | print next_beam |
|
43 | print (next_beam) | |
41 | else: |
|
44 | else: | |
42 | abs_conf.send_beam_num(1) |
|
45 | abs_conf.send_beam_num(1) | |
43 | beams_list[0].set_as_activebeam() |
|
46 | beams_list[0].set_as_activebeam() | |
44 | task = task_change_beam.apply_async((abs_conf.pk,), eta=date) |
|
47 | task = task_change_beam.apply_async((abs_conf.pk,), eta=date) | |
45 | print beams_list[0] |
|
48 | print (beams_list[0]) | |
46 | i=0 |
|
49 | i=0 | |
47 |
|
50 | |||
48 | else: |
|
51 | else: |
@@ -69,7 +69,7 class CampaignForm(forms.ModelForm): | |||||
69 | def __init__(self, *args, **kwargs): |
|
69 | def __init__(self, *args, **kwargs): | |
70 | super(CampaignForm, self).__init__(*args, **kwargs) |
|
70 | super(CampaignForm, self).__init__(*args, **kwargs) | |
71 | self.fields['start_date'].widget = DatepickerWidget(self.fields['start_date'].widget.attrs) |
|
71 | self.fields['start_date'].widget = DatepickerWidget(self.fields['start_date'].widget.attrs) | |
72 | self.fields['end_date'].widget = DatepickerWidget(self.fields['end_date'].widget.attrs) |
|
72 | self.fields['end_date'].widget = DatepickerWidget(self.fields['end_date'].widget.attrs) | |
73 | self.fields['description'].widget.attrs = {'rows': 2} |
|
73 | self.fields['description'].widget.attrs = {'rows': 2} | |
74 |
|
74 | |||
75 | if self.instance.pk: |
|
75 | if self.instance.pk: | |
@@ -85,10 +85,10 class ExperimentForm(forms.ModelForm): | |||||
85 | def __init__(self, *args, **kwargs): |
|
85 | def __init__(self, *args, **kwargs): | |
86 | super(ExperimentForm, self).__init__(*args, **kwargs) |
|
86 | super(ExperimentForm, self).__init__(*args, **kwargs) | |
87 | self.fields['start_time'].widget = TimepickerWidget(self.fields['start_time'].widget.attrs) |
|
87 | self.fields['start_time'].widget = TimepickerWidget(self.fields['start_time'].widget.attrs) | |
88 | self.fields['end_time'].widget = TimepickerWidget(self.fields['end_time'].widget.attrs) |
|
88 | self.fields['end_time'].widget = TimepickerWidget(self.fields['end_time'].widget.attrs) | |
89 |
|
89 | |||
90 | def save(self, *args, **kwargs): |
|
90 | def save(self, *args, **kwargs): | |
91 | exp = super(ExperimentForm, self).save(*args, **kwargs) |
|
91 | exp = super(ExperimentForm, self).save(*args, **kwargs) | |
92 | exp.name = exp.name.replace(' ', '') |
|
92 | exp.name = exp.name.replace(' ', '') | |
93 | exp.save() |
|
93 | exp.save() | |
94 | return exp |
|
94 | return exp | |
@@ -153,7 +153,7 class OperationForm(forms.Form): | |||||
153 |
|
153 | |||
154 | campaigns = kwargs.pop('campaigns') |
|
154 | campaigns = kwargs.pop('campaigns') | |
155 | super(OperationForm, self).__init__(*args, **kwargs) |
|
155 | super(OperationForm, self).__init__(*args, **kwargs) | |
156 | self.fields['campaign'].label = 'Current Campaigns' |
|
156 | self.fields['campaign'].label = 'Current Campaigns' | |
157 | self.fields['campaign'].choices = add_empty_choice(campaigns.values_list('id', 'name')) |
|
157 | self.fields['campaign'].choices = add_empty_choice(campaigns.values_list('id', 'name')) | |
158 |
|
158 | |||
159 |
|
159 | |||
@@ -201,6 +201,6 class FilterForm(forms.Form): | |||||
201 | class ChangeIpForm(forms.Form): |
|
201 | class ChangeIpForm(forms.Form): | |
202 |
|
202 | |||
203 | ip_address = forms.GenericIPAddressField() |
|
203 | ip_address = forms.GenericIPAddressField() | |
204 | mask = forms.GenericIPAddressField(initial='255.255.255.0') |
|
204 | mask = forms.GenericIPAddressField(initial='255.255.255.0') | |
205 | gateway = forms.GenericIPAddressField(initial='0.0.0.0') |
|
205 | gateway = forms.GenericIPAddressField(initial='0.0.0.0') | |
206 | dns = forms.GenericIPAddressField(initial='0.0.0.0') |
|
206 | dns = forms.GenericIPAddressField(initial='0.0.0.0') |
@@ -132,13 +132,13 class DeviceType(models.Model): | |||||
132 |
|
132 | |||
133 | class Device(models.Model): |
|
133 | class Device(models.Model): | |
134 |
|
134 | |||
135 | device_type = models.ForeignKey('DeviceType', on_delete=models.CASCADE) |
|
135 | device_type = models.ForeignKey('DeviceType', on_delete=models.CASCADE) | |
136 | location = models.ForeignKey('Location', on_delete=models.CASCADE) |
|
136 | location = models.ForeignKey('Location', on_delete=models.CASCADE) | |
137 | ip_address = models.GenericIPAddressField(protocol='IPv4', default='0.0.0.0') |
|
137 | ip_address = models.GenericIPAddressField(protocol='IPv4', default='0.0.0.0') | |
138 | port_address = models.PositiveSmallIntegerField(default=2000) |
|
138 | port_address = models.PositiveSmallIntegerField(default=2000) | |
139 | description = models.TextField(blank=True, null=True) |
|
139 | description = models.TextField(blank=True, null=True) | |
140 | status = models.PositiveSmallIntegerField(default=4, choices=DEV_STATES) |
|
140 | status = models.PositiveSmallIntegerField(default=4, choices=DEV_STATES) | |
141 | conf_active = models.PositiveIntegerField(default=0, verbose_name='Current configuration') |
|
141 | conf_active = models.PositiveIntegerField(default=0, verbose_name='Current configuration') | |
142 |
|
142 | |||
143 | class Meta: |
|
143 | class Meta: | |
144 | db_table = 'db_devices' |
|
144 | db_table = 'db_devices' | |
@@ -209,10 +209,10 class Device(models.Model): | |||||
209 | headers = {'content-type': "application/json", |
|
209 | headers = {'content-type': "application/json", | |
210 | 'cache-control': "no-cache"} |
|
210 | 'cache-control': "no-cache"} | |
211 |
|
211 | |||
212 | ip = [int(x) for x in ip_address.split('.')] |
|
212 | ip = [int(x) for x in ip_address.split('.')] | |
213 | dns = [int(x) for x in dns.split('.')] |
|
213 | dns = [int(x) for x in dns.split('.')] | |
214 | gateway = [int(x) for x in gateway.split('.')] |
|
214 | gateway = [int(x) for x in gateway.split('.')] | |
215 | subnet = [int(x) for x in mask.split('.')] |
|
215 | subnet = [int(x) for x in mask.split('.')] | |
216 |
|
216 | |||
217 | payload = { |
|
217 | payload = { | |
218 | "ip": ip, |
|
218 | "ip": ip, | |
@@ -225,7 +225,7 class Device(models.Model): | |||||
225 | try: |
|
225 | try: | |
226 | answer = req.json() |
|
226 | answer = req.json() | |
227 | if answer['changeip']=='ok': |
|
227 | if answer['changeip']=='ok': | |
228 | self.message = '25|IP succesfully changed' |
|
228 | self.message = '25|IP succesfully changed' | |
229 | self.ip_address = ip_address |
|
229 | self.ip_address = ip_address | |
230 | self.save() |
|
230 | self.save() | |
231 | else: |
|
231 | else: | |
@@ -241,14 +241,14 class Device(models.Model): | |||||
241 |
|
241 | |||
242 | class Campaign(models.Model): |
|
242 | class Campaign(models.Model): | |
243 |
|
243 | |||
244 | template = models.BooleanField(default=False) |
|
244 | template = models.BooleanField(default=False) | |
245 | name = models.CharField(max_length=60, unique=True) |
|
245 | name = models.CharField(max_length=60, unique=True) | |
246 | start_date = models.DateTimeField(blank=True, null=True) |
|
246 | start_date = models.DateTimeField(blank=True, null=True) | |
247 | end_date = models.DateTimeField(blank=True, null=True) |
|
247 | end_date = models.DateTimeField(blank=True, null=True) | |
248 | tags = models.CharField(max_length=40, blank=True, null=True) |
|
248 | tags = models.CharField(max_length=40, blank=True, null=True) | |
249 | description = models.TextField(blank=True, null=True) |
|
249 | description = models.TextField(blank=True, null=True) | |
250 | experiments = models.ManyToManyField('Experiment', blank=True) |
|
250 | experiments = models.ManyToManyField('Experiment', blank=True) | |
251 | author = models.ForeignKey(User, null=True, blank=True,on_delete=models.CASCADE) |
|
251 | author = models.ForeignKey(User, null=True, blank=True,on_delete=models.CASCADE) | |
252 |
|
252 | |||
253 | class Meta: |
|
253 | class Meta: | |
254 | db_table = 'db_campaigns' |
|
254 | db_table = 'db_campaigns' | |
@@ -272,7 +272,7 class Campaign(models.Model): | |||||
272 | data[field.name] = field.value_from_object(self) |
|
272 | data[field.name] = field.value_from_object(self) | |
273 |
|
273 | |||
274 | data['start_date'] = data['start_date'].strftime('%Y-%m-%d') |
|
274 | data['start_date'] = data['start_date'].strftime('%Y-%m-%d') | |
275 | data['end_date'] = data['end_date'].strftime('%Y-%m-%d') |
|
275 | data['end_date'] = data['end_date'].strftime('%Y-%m-%d') | |
276 |
|
276 | |||
277 | return data |
|
277 | return data | |
278 |
|
278 | |||
@@ -311,10 +311,10 class Campaign(models.Model): | |||||
311 |
|
311 | |||
312 | camp_parms = parms['campaigns']['byId'][parms['campaigns']['allIds'][0]] |
|
312 | camp_parms = parms['campaigns']['byId'][parms['campaigns']['allIds'][0]] | |
313 |
|
313 | |||
314 | self.name = '{}-{}'.format(camp_parms['name'], datetime.now().strftime('%y%m%d')) |
|
314 | self.name = '{}-{}'.format(camp_parms['name'], datetime.now().strftime('%y%m%d')) | |
315 | self.start_date = camp_parms['start_date'] |
|
315 | self.start_date = camp_parms['start_date'] | |
316 | self.end_date = camp_parms['end_date'] |
|
316 | self.end_date = camp_parms['end_date'] | |
317 | self.tags = camp_parms['tags'] |
|
317 | self.tags = camp_parms['tags'] | |
318 | self.save() |
|
318 | self.save() | |
319 |
|
319 | |||
320 | return self |
|
320 | return self | |
@@ -329,8 +329,8 class Campaign(models.Model): | |||||
329 |
|
329 | |||
330 | for loc in locations: |
|
330 | for loc in locations: | |
331 | dum = {} |
|
331 | dum = {} | |
332 | dum['name'] = loc.name |
|
332 | dum['name'] = loc.name | |
333 | dum['id'] = loc.pk |
|
333 | dum['id'] = loc.pk | |
334 | dum['experiments'] = [e for e in self.experiments.all() if e.location==loc] |
|
334 | dum['experiments'] = [e for e in self.experiments.all() if e.location==loc] | |
335 | ret.append(dum) |
|
335 | ret.append(dum) | |
336 |
|
336 | |||
@@ -353,23 +353,23 class Campaign(models.Model): | |||||
353 |
|
353 | |||
354 |
|
354 | |||
355 | class RunningExperiment(models.Model): |
|
355 | class RunningExperiment(models.Model): | |
356 | radar = models.OneToOneField('Location', on_delete=models.CASCADE) |
|
356 | radar = models.OneToOneField('Location', on_delete=models.CASCADE) | |
357 | running_experiment = models.ManyToManyField('Experiment', blank = True) |
|
357 | running_experiment = models.ManyToManyField('Experiment', blank = True) | |
358 | status = models.PositiveSmallIntegerField(default=0, choices=RADAR_STATES) |
|
358 | status = models.PositiveSmallIntegerField(default=0, choices=RADAR_STATES) | |
359 |
|
359 | |||
360 |
|
360 | |||
361 | class Experiment(models.Model): |
|
361 | class Experiment(models.Model): | |
362 |
|
362 | |||
363 | template = models.BooleanField(default=False) |
|
363 | template = models.BooleanField(default=False) | |
364 | name = models.CharField(max_length=40, default='', unique=True) |
|
364 | name = models.CharField(max_length=40, default='', unique=True) | |
365 | location = models.ForeignKey('Location', null=True, blank=True, on_delete=models.CASCADE) |
|
365 | location = models.ForeignKey('Location', null=True, blank=True, on_delete=models.CASCADE) | |
366 | freq = models.FloatField(verbose_name='Operating Freq. (MHz)', validators=[MinValueValidator(1), MaxValueValidator(10000)], default=49.9200) |
|
366 | freq = models.FloatField(verbose_name='Operating Freq. (MHz)', validators=[MinValueValidator(1), MaxValueValidator(10000)], default=49.9200) | |
367 | start_time = models.TimeField(default='00:00:00') |
|
367 | start_time = models.TimeField(default='00:00:00') | |
368 | end_time = models.TimeField(default='23:59:59') |
|
368 | end_time = models.TimeField(default='23:59:59') | |
369 | task = models.CharField(max_length=36, default='', blank=True, null=True) |
|
369 | task = models.CharField(max_length=36, default='', blank=True, null=True) | |
370 | status = models.PositiveSmallIntegerField(default=4, choices=EXP_STATES) |
|
370 | status = models.PositiveSmallIntegerField(default=4, choices=EXP_STATES) | |
371 | author = models.ForeignKey(User, null=True, blank=True,on_delete=models.CASCADE) |
|
371 | author = models.ForeignKey(User, null=True, blank=True,on_delete=models.CASCADE) | |
372 | hash = models.CharField(default='', max_length=64, null=True, blank=True) |
|
372 | hash = models.CharField(default='', max_length=64, null=True, blank=True) | |
373 |
|
373 | |||
374 | class Meta: |
|
374 | class Meta: | |
375 | db_table = 'db_experiments' |
|
375 | db_table = 'db_experiments' | |
@@ -393,8 +393,8 class Experiment(models.Model): | |||||
393 | data[field.name] = field.value_from_object(self) |
|
393 | data[field.name] = field.value_from_object(self) | |
394 |
|
394 | |||
395 | data['start_time'] = data['start_time'].strftime('%H:%M:%S') |
|
395 | data['start_time'] = data['start_time'].strftime('%H:%M:%S') | |
396 | data['end_time'] = data['end_time'].strftime('%H:%M:%S') |
|
396 | data['end_time'] = data['end_time'].strftime('%H:%M:%S') | |
397 | data['location'] = self.location.name |
|
397 | data['location'] = self.location.name | |
398 | data['configurations'] = ['{}'.format(conf.pk) for |
|
398 | data['configurations'] = ['{}'.format(conf.pk) for | |
399 | conf in Configuration.objects.filter(experiment=self, type=0)] |
|
399 | conf in Configuration.objects.filter(experiment=self, type=0)] | |
400 |
|
400 | |||
@@ -427,7 +427,7 class Experiment(models.Model): | |||||
427 |
|
427 | |||
428 | confs = [] |
|
428 | confs = [] | |
429 | allconfs = Configuration.objects.filter(experiment=self, type = 0).order_by('-device__device_type__sequence') |
|
429 | allconfs = Configuration.objects.filter(experiment=self, type = 0).order_by('-device__device_type__sequence') | |
430 | rc_mix = [conf for conf in allconfs if conf.device.device_type.name=='rc' and conf.mix] |
|
430 | rc_mix = [conf for conf in allconfs if conf.device.device_type.name=='rc' and conf.mix] | |
431 | if rc_mix: |
|
431 | if rc_mix: | |
432 | for conf in allconfs: |
|
432 | for conf in allconfs: | |
433 | if conf.device.device_type.name == 'rc' and not conf.mix: |
|
433 | if conf.device.device_type.name == 'rc' and not conf.mix: | |
@@ -456,7 +456,7 class Experiment(models.Model): | |||||
456 | ''' |
|
456 | ''' | |
457 |
|
457 | |||
458 | confs = Configuration.objects.filter(experiment=self, type = 0).order_by('device__device_type__sequence') |
|
458 | confs = Configuration.objects.filter(experiment=self, type = 0).order_by('device__device_type__sequence') | |
459 | confs=confs.exclude(device__device_type__name='cgs') |
|
459 | confs = confs.exclude(device__device_type__name='cgs') | |
460 | try: |
|
460 | try: | |
461 | for conf in confs: |
|
461 | for conf in confs: | |
462 | conf.stop_device() |
|
462 | conf.stop_device() | |
@@ -529,8 +529,8 class Experiment(models.Model): | |||||
529 |
|
529 | |||
530 | for id_conf in exp_parms['configurations']: |
|
530 | for id_conf in exp_parms['configurations']: | |
531 | conf_parms = parms['configurations']['byId'][id_conf] |
|
531 | conf_parms = parms['configurations']['byId'][id_conf] | |
532 | device = Device.objects.filter(device_type__name=conf_parms['device_type'])[0] |
|
532 | device = Device.objects.filter(device_type__name=conf_parms['device_type'])[0] | |
533 | model = CONF_MODELS[conf_parms['device_type']] |
|
533 | model = CONF_MODELS[conf_parms['device_type']] | |
534 | conf = model( |
|
534 | conf = model( | |
535 | experiment = self, |
|
535 | experiment = self, | |
536 | device = device, |
|
536 | device = device, | |
@@ -540,9 +540,9 class Experiment(models.Model): | |||||
540 |
|
540 | |||
541 | location, created = Location.objects.get_or_create(name=exp_parms['location']) |
|
541 | location, created = Location.objects.get_or_create(name=exp_parms['location']) | |
542 | self.name = '{}-{}'.format(exp_parms['name'], datetime.now().strftime('%y%m%d')) |
|
542 | self.name = '{}-{}'.format(exp_parms['name'], datetime.now().strftime('%y%m%d')) | |
543 | self.location = location |
|
543 | self.location = location | |
544 | self.start_time = exp_parms['start_time'] |
|
544 | self.start_time = exp_parms['start_time'] | |
545 | self.end_time = exp_parms['end_time'] |
|
545 | self.end_time = exp_parms['end_time'] | |
546 | self.save() |
|
546 | self.save() | |
547 |
|
547 | |||
548 | return self |
|
548 | return self | |
@@ -571,17 +571,17 class Experiment(models.Model): | |||||
571 |
|
571 | |||
572 | class Configuration(PolymorphicModel): |
|
572 | class Configuration(PolymorphicModel): | |
573 |
|
573 | |||
574 | template = models.BooleanField(default=False) |
|
574 | template = models.BooleanField(default=False) | |
575 | # name = models.CharField(verbose_name="Configuration Name", max_length=40, default='') |
|
575 | # name = models.CharField(verbose_name="Configuration Name", max_length=40, default='') | |
576 | device = models.ForeignKey('Device', verbose_name='Device', null=True, on_delete=models.CASCADE) |
|
576 | device = models.ForeignKey('Device', verbose_name='Device', null=True, on_delete=models.CASCADE) | |
577 | label = models.CharField(verbose_name="Label", max_length=40, default='', blank=True, null=True) |
|
577 | label = models.CharField(verbose_name="Label", max_length=40, default='', blank=True, null=True) | |
578 | experiment = models.ForeignKey('Experiment', verbose_name='Experiment', null=True, blank=True, on_delete=models.CASCADE) |
|
578 | experiment = models.ForeignKey('Experiment', verbose_name='Experiment', null=True, blank=True, on_delete=models.CASCADE) | |
579 | type = models.PositiveSmallIntegerField(default=0, choices=CONF_TYPES) |
|
579 | type = models.PositiveSmallIntegerField(default=0, choices=CONF_TYPES) | |
580 | created_date = models.DateTimeField(auto_now_add=True) |
|
580 | created_date = models.DateTimeField(auto_now_add=True) | |
581 | programmed_date = models.DateTimeField(auto_now=True) |
|
581 | programmed_date = models.DateTimeField(auto_now=True) | |
582 | parameters = models.TextField(default='{}') |
|
582 | parameters = models.TextField(default='{}') | |
583 | author = models.ForeignKey(User, null=True, blank=True,on_delete=models.CASCADE) |
|
583 | author = models.ForeignKey(User, null=True, blank=True,on_delete=models.CASCADE) | |
584 | hash = models.CharField(default='', max_length=64, null=True, blank=True) |
|
584 | hash = models.CharField(default='', max_length=64, null=True, blank=True) | |
585 | message = "" |
|
585 | message = "" | |
586 |
|
586 | |||
587 | class Meta: |
|
587 | class Meta: |
@@ -5,18 +5,28 from celery import task | |||||
5 | from datetime import timedelta, datetime |
|
5 | from datetime import timedelta, datetime | |
6 |
|
6 | |||
7 | from .models import Experiment |
|
7 | from .models import Experiment | |
|
8 | from celery import Celery | |||
|
9 | ||||
|
10 | from celery.utils.log import get_task_logger | |||
|
11 | ||||
|
12 | from django.utils import timezone | |||
|
13 | ||||
|
14 | logger = get_task_logger(__name__) | |||
8 |
|
15 | |||
9 | @task |
|
16 | @task | |
10 | def task_start(id_exp): |
|
17 | def task_start(id_exp): | |
11 | exp = Experiment.objects.get(pk=id_exp) |
|
18 | exp = Experiment.objects.get(pk=id_exp) | |
12 | status = exp.status |
|
19 | status = exp.status | |
13 | if exp.status == 2: |
|
20 | if exp.status == 2: | |
14 | print('Experiment {} already running start task not executed'.format(exp)) |
|
21 | print('Experiment {} already running start task not executed'.format(exp)) | |
15 | return 2 |
|
22 | return 2 | |
16 | if status == 3: |
|
23 | if status == 3: | |
17 | now = datetime.now() |
|
24 | now = datetime.now() | |
18 | start = datetime.combine(now.date(), exp.start_time) |
|
25 | start = datetime.combine(now.date(), exp.start_time) | |
19 | end = datetime.combine(now.date(), exp.end_time) |
|
26 | end = datetime.combine(now.date(), exp.end_time) | |
|
27 | print(now) | |||
|
28 | print(start) | |||
|
29 | print(end) | |||
20 | if end < start: |
|
30 | if end < start: | |
21 | end += timedelta(1) |
|
31 | end += timedelta(1) | |
22 | try: |
|
32 | try: | |
@@ -26,7 +36,7 def task_start(id_exp): | |||||
26 | print('Error') |
|
36 | print('Error') | |
27 | exp.status = 0 |
|
37 | exp.status = 0 | |
28 | if exp.status == 2: |
|
38 | if exp.status == 2: | |
29 |
task = task_stop.apply_async((id_exp,), |
|
39 | task = task_stop.apply_async((id_exp,),eta=end) #Antiguo eta=end+timedelta(hours=5)) | |
30 | exp.task = task.id |
|
40 | exp.task = task.id | |
31 | exp.save() |
|
41 | exp.save() | |
32 | return exp.status |
|
42 | return exp.status | |
@@ -42,10 +52,10 def task_stop(id_exp): | |||||
42 | print('Error') |
|
52 | print('Error') | |
43 | exp.status = 0 |
|
53 | exp.status = 0 | |
44 |
|
54 | |||
45 | now = datetime.now() |
|
55 | now = datetime.now() | |
46 | start = datetime.combine(now.date()+timedelta(1), exp.start_time) |
|
56 | start = datetime.combine(now.date()+timedelta(1), exp.start_time) | |
47 |
task = task_start.apply_async((id_exp, ), eta=start |
|
57 | task = task_start.apply_async((id_exp, ), eta=start) #Antiguo eta=start+timedelta(hours=5)) | |
48 | exp.task = task.id |
|
58 | exp.task = task.id | |
49 | exp.status = 3 |
|
59 | exp.status = 3 | |
50 | exp.save() |
|
60 | exp.save() | |
51 | return exp.status |
|
61 | return exp.status | |
@@ -53,12 +63,12 def task_stop(id_exp): | |||||
53 | #Task to get status |
|
63 | #Task to get status | |
54 | @task |
|
64 | @task | |
55 | def task_status(id_exp): |
|
65 | def task_status(id_exp): | |
56 |
|
66 | print ("task status"+str(id_exp)) | ||
57 | exp = Experiment.objects.get(pk=id_exp) |
|
67 | exp = Experiment.objects.get(pk=id_exp) | |
58 | if exp.status==2: |
|
68 | if exp.status==2: | |
59 | run_every = timedelta(minutes=1) |
|
69 | run_every = timedelta(minutes=1) | |
60 | now = datetime.utcnow() |
|
70 | now = datetime.utcnow() | |
61 | date = now + run_every |
|
71 | date = now + run_every | |
62 | task_status.apply_async((id_exp,), eta=date) |
|
72 | task_status.apply_async((id_exp,), eta=date) | |
63 | print ("Monitoring...") |
|
73 | print ("Monitoring...") | |
64 | exp.get_status() |
|
74 | exp.get_status() |
@@ -46,6 +46,7 urlpatterns = ( | |||||
46 |
|
46 | |||
47 | path('experiment/<int:id_exp>/new_dev_conf/', views.dev_conf_new, name='url_add_dev_conf'), |
|
47 | path('experiment/<int:id_exp>/new_dev_conf/', views.dev_conf_new, name='url_add_dev_conf'), | |
48 | path('experiment/<int:id_exp>/new_dev_conf/<int:id_dev>/', views.dev_conf_new, name='url_add_dev_conf'), |
|
48 | path('experiment/<int:id_exp>/new_dev_conf/<int:id_dev>/', views.dev_conf_new, name='url_add_dev_conf'), | |
|
49 | ||||
49 | path('dev_conf/', views.dev_confs, name='url_dev_confs'), |
|
50 | path('dev_conf/', views.dev_confs, name='url_dev_confs'), | |
50 | path('dev_conf/<int:id_conf>/', views.dev_conf, name='url_dev_conf'), |
|
51 | path('dev_conf/<int:id_conf>/', views.dev_conf, name='url_dev_conf'), | |
51 | path('dev_conf/<int:id_conf>/edit/', views.dev_conf_edit, name='url_edit_dev_conf'), |
|
52 | path('dev_conf/<int:id_conf>/edit/', views.dev_conf_edit, name='url_edit_dev_conf'), |
@@ -13,6 +13,8 from django.contrib import messages | |||||
13 | from django.http.request import QueryDict |
|
13 | from django.http.request import QueryDict | |
14 | from django.contrib.auth.decorators import login_required, user_passes_test |
|
14 | from django.contrib.auth.decorators import login_required, user_passes_test | |
15 |
|
15 | |||
|
16 | from django.utils.timezone import is_aware | |||
|
17 | ||||
16 | try: |
|
18 | try: | |
17 | from urllib.parse import urlencode |
|
19 | from urllib.parse import urlencode | |
18 | except ImportError: |
|
20 | except ImportError: | |
@@ -21,8 +23,6 except ImportError: | |||||
21 | from .forms import CampaignForm, ExperimentForm, DeviceForm, ConfigurationForm, LocationForm, UploadFileForm, DownloadFileForm, OperationForm, NewForm |
|
23 | from .forms import CampaignForm, ExperimentForm, DeviceForm, ConfigurationForm, LocationForm, UploadFileForm, DownloadFileForm, OperationForm, NewForm | |
22 | from .forms import OperationSearchForm, FilterForm, ChangeIpForm |
|
24 | from .forms import OperationSearchForm, FilterForm, ChangeIpForm | |
23 |
|
25 | |||
24 | from .tasks import task_start |
|
|||
25 |
|
||||
26 | from apps.rc.forms import RCConfigurationForm, RCLineCode, RCMixConfigurationForm |
|
26 | from apps.rc.forms import RCConfigurationForm, RCLineCode, RCMixConfigurationForm | |
27 | from apps.dds.forms import DDSConfigurationForm |
|
27 | from apps.dds.forms import DDSConfigurationForm | |
28 | from apps.jars.forms import JARSConfigurationForm |
|
28 | from apps.jars.forms import JARSConfigurationForm | |
@@ -32,18 +32,19 from apps.usrp.forms import USRPConfigurationForm | |||||
32 | from apps.dds_rest.forms import DDSRestConfigurationForm |
|
32 | from apps.dds_rest.forms import DDSRestConfigurationForm | |
33 | from .utils import Params |
|
33 | from .utils import Params | |
34 |
|
34 | |||
35 | from .models import Campaign, Experiment, Device, Configuration, Location, RunningExperiment, DEV_STATES |
|
35 | from .models import Campaign, Experiment, Device, Configuration, Location, RunningExperiment, DEV_STATES | |
36 | from apps.cgs.models import CGSConfiguration |
|
36 | from apps.cgs.models import CGSConfiguration | |
37 | from apps.jars.models import JARSConfiguration, EXPERIMENT_TYPE |
|
37 | from apps.jars.models import JARSConfiguration, EXPERIMENT_TYPE | |
38 | from apps.usrp.models import USRPConfiguration |
|
38 | from apps.usrp.models import USRPConfiguration | |
39 | from apps.abs.models import ABSConfiguration |
|
39 | from apps.abs.models import ABSConfiguration | |
40 | from apps.rc.models import RCConfiguration, RCLine, RCLineType, RCClock |
|
40 | from apps.rc.models import RCConfiguration, RCLine, RCLineType, RCClock | |
41 | from apps.dds.models import DDSConfiguration |
|
41 | from apps.dds.models import DDSConfiguration | |
42 | from apps.dds_rest.models import DDSRestConfiguration |
|
42 | from apps.dds_rest.models import DDSRestConfiguration | |
43 |
|
43 | |||
|
44 | from .tasks import task_start | |||
44 | from radarsys.celery import app |
|
45 | from radarsys.celery import app | |
45 |
|
46 | |||
46 |
|
47 | #comentario test | ||
47 | CONF_FORMS = { |
|
48 | CONF_FORMS = { | |
48 | 'rc': RCConfigurationForm, |
|
49 | 'rc': RCConfigurationForm, | |
49 | 'dds': DDSConfigurationForm, |
|
50 | 'dds': DDSConfigurationForm, | |
@@ -442,9 +443,9 def campaign_new(request): | |||||
442 | campaign.save() |
|
443 | campaign.save() | |
443 | return redirect('url_campaign', id_camp=campaign.id) |
|
444 | return redirect('url_campaign', id_camp=campaign.id) | |
444 |
|
445 | |||
445 | kwargs['form'] = form |
|
446 | kwargs['form'] = form | |
446 | kwargs['title'] = 'Campaign' |
|
447 | kwargs['title'] = 'Campaign' | |
447 | kwargs['suptitle'] = 'New' |
|
448 | kwargs['suptitle'] = 'New' | |
448 | kwargs['menu_campaigns'] = 'active' |
|
449 | kwargs['menu_campaigns'] = 'active' | |
449 |
|
450 | |||
450 | return render(request, 'campaign_edit.html', kwargs) |
|
451 | return render(request, 'campaign_edit.html', kwargs) | |
@@ -459,11 +460,11 def campaign_edit(request, id_camp): | |||||
459 | form = CampaignForm(instance=campaign) |
|
460 | form = CampaignForm(instance=campaign) | |
460 |
|
461 | |||
461 | if request.method == 'POST': |
|
462 | if request.method == 'POST': | |
462 | exps = campaign.experiments.all().values_list('pk', flat=True) |
|
463 | exps = campaign.experiments.all().values_list('pk', flat=True) | |
463 | post = request.POST.copy() |
|
464 | post = request.POST.copy() | |
464 | new_exps = post.getlist('experiments') |
|
465 | new_exps = post.getlist('experiments') | |
465 | post.setlist('experiments', []) |
|
466 | post.setlist('experiments', []) | |
466 | form = CampaignForm(post, instance=campaign) |
|
467 | form = CampaignForm(post, instance=campaign) | |
467 |
|
468 | |||
468 | if form.is_valid(): |
|
469 | if form.is_valid(): | |
469 | camp = form.save() |
|
470 | camp = form.save() | |
@@ -482,11 +483,11 def campaign_edit(request, id_camp): | |||||
482 |
|
483 | |||
483 | return redirect('url_campaign', id_camp=id_camp) |
|
484 | return redirect('url_campaign', id_camp=id_camp) | |
484 |
|
485 | |||
485 | kwargs = {} |
|
486 | kwargs = {} | |
486 | kwargs['form'] = form |
|
487 | kwargs['form'] = form | |
487 | kwargs['title'] = 'Campaign' |
|
488 | kwargs['title'] = 'Campaign' | |
488 | kwargs['suptitle'] = 'Edit' |
|
489 | kwargs['suptitle'] = 'Edit' | |
489 | kwargs['button'] = 'Update' |
|
490 | kwargs['button'] = 'Update' | |
490 | kwargs['menu_campaigns'] = 'active' |
|
491 | kwargs['menu_campaigns'] = 'active' | |
491 |
|
492 | |||
492 | return render(request, 'campaign_edit.html', kwargs) |
|
493 | return render(request, 'campaign_edit.html', kwargs) | |
@@ -694,11 +695,11 def experiment_edit(request, id_exp): | |||||
694 | experiment = form.save() |
|
695 | experiment = form.save() | |
695 | return redirect('url_experiment', id_exp=experiment.id) |
|
696 | return redirect('url_experiment', id_exp=experiment.id) | |
696 |
|
697 | |||
697 | kwargs = {} |
|
698 | kwargs = {} | |
698 | kwargs['form'] = form |
|
699 | kwargs['form'] = form | |
699 | kwargs['title'] = 'Experiment' |
|
700 | kwargs['title'] = 'Experiment' | |
700 | kwargs['suptitle'] = 'Edit' |
|
701 | kwargs['suptitle'] = 'Edit' | |
701 | kwargs['button'] = 'Update' |
|
702 | kwargs['button'] = 'Update' | |
702 | kwargs['menu_experiments'] = 'active' |
|
703 | kwargs['menu_experiments'] = 'active' | |
703 |
|
704 | |||
704 | return render(request, 'experiment_edit.html', kwargs) |
|
705 | return render(request, 'experiment_edit.html', kwargs) | |
@@ -1790,12 +1791,24 def operation(request, id_camp=None): | |||||
1790 | @login_required |
|
1791 | @login_required | |
1791 | def radar_start(request, id_camp, id_radar): |
|
1792 | def radar_start(request, id_camp, id_radar): | |
1792 |
|
1793 | |||
1793 | campaign = get_object_or_404(Campaign, pk=id_camp) |
|
1794 | campaign = get_object_or_404(Campaign, pk=id_camp) | |
1794 | experiments = campaign.get_experiments_by_radar(id_radar)[0]['experiments'] |
|
1795 | experiments = campaign.get_experiments_by_radar(id_radar)[0]['experiments'] | |
1795 | now = datetime.now() |
|
1796 | now = datetime.now() | |
|
1797 | ||||
1796 | for exp in experiments: |
|
1798 | for exp in experiments: | |
|
1799 | #app.control.revoke(exp.task) | |||
|
1800 | print(exp.status) | |||
1797 | start = datetime.combine(datetime.now().date(), exp.start_time) |
|
1801 | start = datetime.combine(datetime.now().date(), exp.start_time) | |
1798 | end = datetime.combine(datetime.now().date(), exp.end_time) |
|
1802 | end = datetime.combine(datetime.now().date(), exp.end_time) | |
|
1803 | print(exp.start_time) | |||
|
1804 | print(exp.end_time) | |||
|
1805 | ||||
|
1806 | print(start) | |||
|
1807 | print(end) | |||
|
1808 | print(is_aware(start)) | |||
|
1809 | print(campaign.start_date) | |||
|
1810 | print(campaign.end_date) | |||
|
1811 | print(is_aware(campaign.start_date)) | |||
1799 | if end < start: |
|
1812 | if end < start: | |
1800 | end += timedelta(1) |
|
1813 | end += timedelta(1) | |
1801 |
|
1814 | |||
@@ -1814,8 +1827,9 def radar_start(request, id_camp, id_radar): | |||||
1814 | continue |
|
1827 | continue | |
1815 |
|
1828 | |||
1816 | app.control.revoke(exp.task) |
|
1829 | app.control.revoke(exp.task) | |
1817 |
|
1830 | print("Llego luego del revoke") | ||
1818 | if now > start and now <= end: |
|
1831 | if now > start and now <= end: | |
|
1832 | print("Caso now >start and <end") | |||
1819 | task = task_start.delay(exp.id) |
|
1833 | task = task_start.delay(exp.id) | |
1820 | exp.status = task.wait() |
|
1834 | exp.status = task.wait() | |
1821 | if exp.status == 0: |
|
1835 | if exp.status == 0: | |
@@ -1823,12 +1837,11 def radar_start(request, id_camp, id_radar): | |||||
1823 | if exp.status == 2: |
|
1837 | if exp.status == 2: | |
1824 | messages.success(request, 'Experiment {} started'.format(exp)) |
|
1838 | messages.success(request, 'Experiment {} started'.format(exp)) | |
1825 | else: |
|
1839 | else: | |
1826 | task = task_start.apply_async( |
|
1840 | print("Caso now < start o >end") | |
1827 |
|
|
1841 | task = task_start.apply_async((exp.pk, ), eta=start)#start+timedelta(hours=5)) | |
1828 | exp.task = task.id |
|
1842 | exp.task = task.id | |
1829 | exp.status = 3 |
|
1843 | exp.status = 3 | |
1830 | messages.success( |
|
1844 | messages.success(request, 'Experiment {} programmed to start at {}'.format(exp, start)) | |
1831 | request, 'Experiment {} programmed to start at {}'.format(exp, start)) |
|
|||
1832 |
|
1845 | |||
1833 | exp.save() |
|
1846 | exp.save() | |
1834 |
|
1847 | |||
@@ -1838,14 +1851,18 def radar_start(request, id_camp, id_radar): | |||||
1838 | @login_required |
|
1851 | @login_required | |
1839 | def radar_stop(request, id_camp, id_radar): |
|
1852 | def radar_stop(request, id_camp, id_radar): | |
1840 |
|
1853 | |||
1841 | campaign = get_object_or_404(Campaign, pk=id_camp) |
|
1854 | campaign = get_object_or_404(Campaign, pk=id_camp) | |
1842 | experiments = campaign.get_experiments_by_radar(id_radar)[0]['experiments'] |
|
1855 | experiments = campaign.get_experiments_by_radar(id_radar)[0]['experiments'] | |
1843 |
|
1856 | print("Ingreso en stop radar_stop") | ||
1844 | for exp in experiments: |
|
1857 | for exp in experiments: | |
1845 |
|
1858 | |||
1846 | if exp.task: |
|
1859 | if exp.task: | |
|
1860 | print("Ingreso antes de revoke stop") | |||
1847 | app.control.revoke(exp.task) |
|
1861 | app.control.revoke(exp.task) | |
1848 | if exp.status == 2: |
|
1862 | ||
|
1863 | ||||
|
1864 | if exp.status == 2: #status 2 es started | |||
|
1865 | print("llama a exp.stop") | |||
1849 | exp.stop() |
|
1866 | exp.stop() | |
1850 | messages.warning(request, 'Experiment {} stopped'.format(exp)) |
|
1867 | messages.warning(request, 'Experiment {} stopped'.format(exp)) | |
1851 | exp.status = 1 |
|
1868 | exp.status = 1 | |
@@ -1857,12 +1874,15 def radar_stop(request, id_camp, id_radar): | |||||
1857 | @login_required |
|
1874 | @login_required | |
1858 | def radar_refresh(request, id_camp, id_radar): |
|
1875 | def radar_refresh(request, id_camp, id_radar): | |
1859 |
|
1876 | |||
1860 | campaign = get_object_or_404(Campaign, pk=id_camp) |
|
1877 | campaign = get_object_or_404(Campaign, pk=id_camp) | |
1861 | experiments = campaign.get_experiments_by_radar(id_radar)[0]['experiments'] |
|
1878 | experiments = campaign.get_experiments_by_radar(id_radar)[0]['experiments'] | |
1862 |
|
1879 | |||
1863 | i = app.control.inspect() |
|
1880 | i = app.control.inspect() | |
1864 | scheduled = i.scheduled().values()[0] |
|
1881 | print(i) | |
1865 | revoked = i.revoked().values()[0] |
|
1882 | print(i.scheduled()) | |
|
1883 | print(i.scheduled().values()) | |||
|
1884 | scheduled = list(i.scheduled().values())[0] | |||
|
1885 | revoked = list(i.revoked().values())[0] | |||
1866 |
|
1886 | |||
1867 | for exp in experiments: |
|
1887 | for exp in experiments: | |
1868 | if exp.task in revoked: |
|
1888 | if exp.task in revoked: | |
@@ -1879,16 +1899,16 def radar_refresh(request, id_camp, id_radar): | |||||
1879 | @login_required |
|
1899 | @login_required | |
1880 | def revoke_tasks(request, id_camp): |
|
1900 | def revoke_tasks(request, id_camp): | |
1881 |
|
1901 | |||
1882 | i = app.control.inspect() |
|
1902 | i = app.control.inspect() | |
1883 | scheduled = i.scheduled().values()[0] |
|
1903 | scheduled = list(i.scheduled().values())[0] | |
1884 | revoked = i.revoked().values()[0] |
|
1904 | revoked = list(i.revoked().values())[0] | |
1885 |
|
1905 | |||
1886 | for t in scheduled: |
|
1906 | for t in scheduled: | |
1887 | if t['request']['id'] in revoked: |
|
1907 | if t['request']['id'] in revoked: | |
1888 | continue |
|
1908 | continue | |
1889 | app.control.revoke(t['request']['id']) |
|
1909 | app.control.revoke(t['request']['id']) | |
1890 | exp = Experiment.objects.get(pk=eval(t['request']['args'])[0]) |
|
1910 | exp = Experiment.objects.get(pk=eval(str(t['request']['args']))[0]) | |
1891 | eta = t['eta'] |
|
1911 | eta = t['eta'] | |
1892 | task = t['request']['name'].split('.')[-1] |
|
1912 | task = t['request']['name'].split('.')[-1] | |
1893 | messages.warning(request, 'Scheduled {} at {} for experiment {} revoked'.format(task, eta, exp.name)) |
|
1913 | messages.warning(request, 'Scheduled {} at {} for experiment {} revoked'.format(task, eta, exp.name)) | |
1894 |
|
1914 | |||
@@ -1897,14 +1917,14 def revoke_tasks(request, id_camp): | |||||
1897 | @login_required |
|
1917 | @login_required | |
1898 | def show_tasks(request, id_camp): |
|
1918 | def show_tasks(request, id_camp): | |
1899 |
|
1919 | |||
1900 | i = app.control.inspect() |
|
1920 | i = app.control.inspect() | |
1901 | scheduled = i.scheduled().values()[0] |
|
1921 | scheduled = list(i.scheduled().values())[0] | |
1902 | revoked = i.revoked().values()[0] |
|
1922 | revoked = list(i.revoked().values())[0] | |
1903 |
|
1923 | |||
1904 | for t in scheduled: |
|
1924 | for t in scheduled: | |
1905 | if t['request']['id'] in revoked: |
|
1925 | if t['request']['id'] in revoked: | |
1906 | continue |
|
1926 | continue | |
1907 | exp = Experiment.objects.get(pk=eval(t['request']['args'])[0]) |
|
1927 | exp = Experiment.objects.get(pk=eval(str(t['request']['args']))[0]) | |
1908 | eta = t['eta'] |
|
1928 | eta = t['eta'] | |
1909 | task = t['request']['name'].split('.')[-1] |
|
1929 | task = t['request']['name'].split('.')[-1] | |
1910 | messages.success(request, 'Task {} scheduled at {} for experiment {}'.format(task, eta, exp.name)) |
|
1930 | messages.success(request, 'Task {} scheduled at {} for experiment {}'.format(task, eta, exp.name)) |
@@ -6,7 +6,7 from django.conf import settings | |||||
6 | # set the default Django settings module for the 'celery' program. |
|
6 | # set the default Django settings module for the 'celery' program. | |
7 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'radarsys.settings') |
|
7 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'radarsys.settings') | |
8 | app = Celery('radarsys') |
|
8 | app = Celery('radarsys') | |
9 |
|
9 | app.conf.timezone = 'America/Lima' | ||
10 | # Using a string here means the worker will not have to |
|
10 | # Using a string here means the worker will not have to | |
11 | # pickle the object when using Windows. |
|
11 | # pickle the object when using Windows. | |
12 | app.config_from_object('django.conf:settings') |
|
12 | app.config_from_object('django.conf:settings') |
@@ -105,14 +105,14 DATABASES = { | |||||
105 |
|
105 | |||
106 | LANGUAGE_CODE = 'en-us' |
|
106 | LANGUAGE_CODE = 'en-us' | |
107 |
|
107 | |||
|
108 | USE_TZ = False | |||
|
109 | ||||
108 | TIME_ZONE = os.environ.get('TZ', 'America/Lima') |
|
110 | TIME_ZONE = os.environ.get('TZ', 'America/Lima') | |
109 |
|
111 | |||
110 | USE_I18N = True |
|
112 | USE_I18N = True | |
111 |
|
113 | |||
112 | USE_L10N = True |
|
114 | USE_L10N = True | |
113 |
|
115 | |||
114 | USE_TZ = False |
|
|||
115 |
|
||||
116 | # Static files (CSS, JavaScript, Images) |
|
116 | # Static files (CSS, JavaScript, Images) | |
117 | # https://docs.djangoproject.com/en/1.8/howto/static-files/ |
|
117 | # https://docs.djangoproject.com/en/1.8/howto/static-files/ | |
118 |
|
118 | |||
@@ -129,7 +129,7 STATICFILES_FINDERS = ( | |||||
129 |
|
129 | |||
130 | # Celery stuff |
|
130 | # Celery stuff | |
131 | REDIS_HOST = os.environ.get('REDIS_HOST', '127.0.0.1') |
|
131 | REDIS_HOST = os.environ.get('REDIS_HOST', '127.0.0.1') | |
132 |
REDIS_PORT = os.environ.get('REDIS_PORT', 63 |
|
132 | REDIS_PORT = os.environ.get('REDIS_PORT', 6379) | |
133 |
|
133 | |||
134 | BROKER_TRANSPORT = 'redis' |
|
134 | BROKER_TRANSPORT = 'redis' | |
135 | BROKER_URL = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT) |
|
135 | BROKER_URL = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT) | |
@@ -140,3 +140,4 CELERY_ACCEPT_CONTENT = ['application/json'] | |||||
140 | CELERY_TASK_SERIALIZER = 'json' |
|
140 | CELERY_TASK_SERIALIZER = 'json' | |
141 | CELERY_RESULT_SERIALIZER = 'json' |
|
141 | CELERY_RESULT_SERIALIZER = 'json' | |
142 | CELERY_ENABLE_UTC = False |
|
142 | CELERY_ENABLE_UTC = False | |
|
143 | CELERY_TIMEZONE = 'America/Lima' |
General Comments 0
You need to be logged in to leave comments.
Login now