django-health-check 3.23.3__tar.gz → 3.23.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. {django_health_check-3.23.3 → django_health_check-3.23.5}/PKG-INFO +1 -1
  2. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/_version.py +3 -3
  3. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/cache/backends.py +20 -6
  4. {django_health_check-3.23.3 → django_health_check-3.23.5}/LICENSE +0 -0
  5. {django_health_check-3.23.3 → django_health_check-3.23.5}/README.md +0 -0
  6. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/__init__.py +0 -0
  7. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/backends.py +0 -0
  8. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/cache/__init__.py +0 -0
  9. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/cache/apps.py +0 -0
  10. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/conf.py +0 -0
  11. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/__init__.py +0 -0
  12. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/celery/__init__.py +0 -0
  13. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/celery/apps.py +0 -0
  14. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/celery/backends.py +0 -0
  15. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/celery/tasks.py +0 -0
  16. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/celery_ping/__init__.py +0 -0
  17. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/celery_ping/apps.py +0 -0
  18. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/celery_ping/backends.py +0 -0
  19. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/db_heartbeat/__init__.py +0 -0
  20. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/db_heartbeat/apps.py +0 -0
  21. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/db_heartbeat/backends.py +0 -0
  22. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/mail/__init__.py +0 -0
  23. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/mail/apps.py +0 -0
  24. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/mail/backends.py +0 -0
  25. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/migrations/__init__.py +0 -0
  26. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/migrations/apps.py +0 -0
  27. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/migrations/backends.py +0 -0
  28. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/psutil/__init__.py +0 -0
  29. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/psutil/apps.py +0 -0
  30. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/psutil/backends.py +0 -0
  31. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/rabbitmq/__init__.py +0 -0
  32. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/rabbitmq/apps.py +0 -0
  33. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/rabbitmq/backends.py +0 -0
  34. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/redis/__init__.py +0 -0
  35. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/redis/apps.py +0 -0
  36. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/redis/backends.py +0 -0
  37. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/s3boto3_storage/__init__.py +0 -0
  38. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/s3boto3_storage/apps.py +0 -0
  39. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/s3boto3_storage/backends.py +0 -0
  40. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/s3boto_storage/__init__.py +0 -0
  41. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/s3boto_storage/apps.py +0 -0
  42. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/contrib/s3boto_storage/backends.py +0 -0
  43. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/db/__init__.py +0 -0
  44. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/db/apps.py +0 -0
  45. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/db/backends.py +0 -0
  46. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/db/migrations/0001_initial.py +0 -0
  47. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/db/migrations/0002_alter_testmodel_options.py +0 -0
  48. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/db/migrations/__init__.py +0 -0
  49. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/db/models.py +0 -0
  50. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/deprecation.py +0 -0
  51. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/exceptions.py +0 -0
  52. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/management/__init__.py +0 -0
  53. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/management/commands/__init__.py +0 -0
  54. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/management/commands/health_check.py +0 -0
  55. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/mixins.py +0 -0
  56. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/plugins.py +0 -0
  57. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/storage/__init__.py +0 -0
  58. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/storage/apps.py +0 -0
  59. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/storage/backends.py +0 -0
  60. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/templates/health_check/index.html +0 -0
  61. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/urls.py +0 -0
  62. {django_health_check-3.23.3 → django_health_check-3.23.5}/health_check/views.py +0 -0
  63. {django_health_check-3.23.3 → django_health_check-3.23.5}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-health-check
3
- Version: 3.23.3
3
+ Version: 3.23.5
4
4
  Summary: Monitor the health of your Django app and its connected services.
5
5
  Keywords: django,postgresql
6
6
  Author-email: Kristian Ollegaard <kristian@oellegaard.com>, Johannes Maron <johannes@maron.family>
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '3.23.3'
32
- __version_tuple__ = version_tuple = (3, 23, 3)
31
+ __version__ = version = '3.23.5'
32
+ __version_tuple__ = version_tuple = (3, 23, 5)
33
33
 
34
- __commit_id__ = commit_id = 'gea6fbff62'
34
+ __commit_id__ = commit_id = 'gb5176b7bf'
@@ -1,5 +1,6 @@
1
1
  import dataclasses
2
- import datetime
2
+ import uuid
3
+ import warnings
3
4
 
4
5
  from django.conf import settings
5
6
  from django.core.cache import CacheKeyWarning, caches
@@ -31,17 +32,30 @@ class CacheBackend(HealthCheck):
31
32
  """
32
33
 
33
34
  alias: str = dataclasses.field(default="default")
34
- cache_key: str = dataclasses.field(
35
+ key_prefix: str = dataclasses.field(default="djangohealthcheck_test", repr=False)
36
+ cache_key: str | None = dataclasses.field(
35
37
  default=getattr(settings, "HEALTHCHECK_CACHE_KEY", "djangohealthcheck_test"), repr=False
36
38
  )
37
39
 
40
+ def __post_init__(self):
41
+ if self.cache_key:
42
+ warnings.warn(
43
+ "`CacheBackend.cache_key` is deprecated and will be removed in next major release. "
44
+ "Use `CacheBackend.key_prefix` instead.",
45
+ DeprecationWarning,
46
+ stacklevel=2,
47
+ )
48
+
38
49
  def check_status(self):
50
+ self.cache_key = f"{self.key_prefix}:{uuid.uuid4().hex}"
39
51
  cache = caches[self.alias]
40
- ts = datetime.datetime.now().timestamp()
41
52
  try:
42
- cache.set(self.cache_key, f"itworks-{ts}")
43
- if not cache.get(self.cache_key) == f"itworks-{ts}":
44
- raise ServiceUnavailable(f"Cache key {self.cache_key} does not match")
53
+ cache.set(
54
+ self.cache_key,
55
+ "itworks",
56
+ )
57
+ if not cache.get(self.cache_key) == "itworks":
58
+ raise ServiceUnavailable(f"Cache key {self.cache_key!r} does not match")
45
59
  except CacheKeyWarning as e:
46
60
  self.add_error(ServiceReturnedUnexpectedResult("Cache key warning"), e)
47
61
  except ValueError as e: