Commit 9d519986 authored by Elia Ponzio's avatar Elia Ponzio
Browse files

Updates

parent a23bd9fc
......@@ -54,11 +54,11 @@ class TaskViewSet(viewsets.ModelViewSet):
task.name = request.data['name']
task.task = "cynomys.tasks.check_ping"
task.interval = IntervalSchedule.objects.get(pk=request.data['interval_id'])
task.args = [request.data['host'], request.data['timeout']]
task.args = '["'+ request.data['host'] +'","'+ request.data['timeout'] + '"]'
task.expire_seconds = 30
task.save()
task.kwargs = {"task_id": task.pk}
task.kwargs = '{"task_id": "' + str(task.pk) + '", "notifier": "email"}'
task.save()
serializer = PeriodicTaskSerializer(task, many=False, context={'request': request})
......@@ -70,11 +70,11 @@ class TaskViewSet(viewsets.ModelViewSet):
task.name = request.data['name']
task.task = "cynomys.tasks.check_http"
task.interval = IntervalSchedule.objects.get(pk=request.data['interval_id'])
task.args = [request.data['host'], request.data['timeout'], request.data['httpcode']]
task.args = '["'+ request.data['host'] +'","'+ request.data['timeout'] + '","'+ request.data['httpcode'] + '"]'
task.expire_seconds = 30
task.save()
task.kwargs = {"task_id": task.pk}
task.kwargs = '{"task_id": "' + str(task.pk) + '", "notifier": "email"}'
task.save()
serializer = PeriodicTaskSerializer(task, many=False, context={'request': request})
......
# Generated by Django 3.2.4 on 2021-06-25 08:38
# Generated by Django 3.2.4 on 2021-06-25 14:03
from django.db import migrations, models
import django.db.models.deletion
......@@ -9,7 +9,7 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('django_celery_beat', '0016_auto_20210625_0828'),
('django_celery_beat', '0016_auto_20210624_1313'),
]
operations = [
......
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