Browse Source

1KB for message bodies is not enough--email headers alone can take 5KB. Changing to 10KB

pull/114/merge
Pēteris Caune 8 years ago
parent
commit
6920439f92
3 changed files with 22 additions and 2 deletions
  1. +20
    -0
      hc/api/migrations/0031_auto_20170509_1320.py
  2. +1
    -1
      hc/api/models.py
  3. +1
    -1
      hc/api/views.py

+ 20
- 0
hc/api/migrations/0031_auto_20170509_1320.py View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-09 13:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0030_check_last_ping_body'),
]
operations = [
migrations.AlterField(
model_name='check',
name='last_ping_body',
field=models.CharField(blank=True, max_length=10000),
),
]

+ 1
- 1
hc/api/models.py View File

@ -65,7 +65,7 @@ class Check(models.Model):
tz = models.CharField(max_length=36, default="UTC")
n_pings = models.IntegerField(default=0)
last_ping = models.DateTimeField(null=True, blank=True)
last_ping_body = models.CharField(max_length=1000, blank=True)
last_ping_body = models.CharField(max_length=10000, blank=True)
alert_after = models.DateTimeField(null=True, blank=True, editable=False)
status = models.CharField(max_length=6, choices=STATUSES, default="new")


+ 1
- 1
hc/api/views.py View File

@ -24,7 +24,7 @@ def ping(request, code):
check.n_pings = F("n_pings") + 1
check.last_ping = timezone.now()
check.last_ping_body = request.body[:1000]
check.last_ping_body = request.body[:10000]
check.alert_after = check.get_alert_after()
if check.status in ("new", "paused"):
check.status = "up"


Loading…
Cancel
Save