diff --git a/hc/api/models.py b/hc/api/models.py index 0c88ab00..22ecf405 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -219,10 +219,7 @@ class Check(models.Model): def ping(self, remote_addr, scheme, method, ua, body, action): if action == "start": - # If we receive multiple start events in a row, - # we remember the first one, not the last one - if self.last_start is None: - self.last_start = timezone.now() + self.last_start = timezone.now() # DOn't update "last_ping" field. else: self.last_start = None diff --git a/hc/api/tests/test_ping.py b/hc/api/tests/test_ping.py index c98501fe..193318ce 100644 --- a/hc/api/tests/test_ping.py +++ b/hc/api/tests/test_ping.py @@ -168,16 +168,3 @@ class PingTestCase(TestCase): self.check.refresh_from_db() self.assertTrue(self.check.last_start) self.assertEqual(self.check.status, "paused") - - def test_start_does_not_overwrite_last_start(self): - first_start = now() - td(hours=2) - - self.check.last_start = first_start - self.check.save() - - r = self.client.get("/ping/%s/start" % self.check.code) - self.assertEqual(r.status_code, 200) - - self.check.refresh_from_db() - # Should still be the original value - self.assertEqual(self.check.last_start, first_start)