WordPress / openverse-api

The Openverse API allows programmatic access to search for CC-licensed and public domain digital media.
https://api.openverse.engineering/v1
MIT License
76 stars 50 forks source link

Add database connectivity to healthcheck endpoint #1079

Closed sarayourfriend closed 1 year ago

sarayourfriend commented 1 year ago

Problem

The healtcheck endpoint should check that the database is accessible. If the db is inaccessible, the service is definitively not healthy.

Description

Add another check (in addition to the ES check) for the database connectivity. Calling django.db.connection.ensure_connection() should be sufficient. It raises an error when the database connection is unavailable.

Alternatives

Additional context