Remove unsplash healthchecks

Their API is more annoying
This commit is contained in:
Jake Howard 2023-08-19 13:59:43 +01:00
parent b8bbc79de4
commit 4d3d6bbc9a
Signed by: jake
GPG Key ID: 57AFB45680EDD477
2 changed files with 0 additions and 31 deletions

View File

@ -1,11 +0,0 @@
from django.apps import AppConfig
from health_check.plugins import plugin_dir
class UnsplashAppConfig(AppConfig):
name = "website.contrib.unsplash"
def ready(self) -> None:
from .healthchecks import UnsplashHealthCheckBackend
plugin_dir.register(UnsplashHealthCheckBackend)

View File

@ -1,20 +0,0 @@
import requests
from django.conf import settings
from health_check.backends import BaseHealthCheckBackend
class UnsplashHealthCheckBackend(BaseHealthCheckBackend):
def check_status(self) -> None:
try:
requests.get(
"https://api.unsplash.com/me",
headers={
"Accept-Version": "v1",
"Authorization": f"Client-ID {settings.UNSPLASH_CLIENT_ID}",
},
).raise_for_status()
except Exception as e:
self.add_error(str(e))
def identifier(self) -> str:
return "Unsplash API"