You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

16 lines
371 B

from django.http import HttpResponse, HttpResponseBadRequest
from django.utils import timezone
from hc.checks.models import Canary
def ping(request, code):
try:
canary = Canary.objects.get(code=code)
except Canary.DoesNotExist:
return HttpResponseBadRequest()
canary.last_ping = timezone.now()
canary.save()
return HttpResponse()