Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lite/src/backend/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ use super::Backend;
use crate::backend::{error::StorageError, kv, stream_id::StreamId};

impl Backend {
pub fn db_status(&self) -> Result<(), slatedb::Error> {
self.db.status()
// TODO: switch to `self.db.status()` once slatedb releases with
// https://github.com/slatedb/slatedb/pull/1234
pub async fn db_status(&self) -> Result<(), slatedb::Error> {
let _ = self.db.get(b"ping").await?;
Ok(())
}

pub(super) async fn db_get<K: AsRef<[u8]> + Send, V>(
Expand Down
2 changes: 1 addition & 1 deletion lite/src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub fn router() -> axum::Router<Backend> {
}

async fn health(State(backend): State<Backend>) -> Response {
match backend.db_status() {
match backend.db_status().await {
Ok(()) => "OK".into_response(),
Err(err) => (StatusCode::SERVICE_UNAVAILABLE, format!("{err:?}")).into_response(),
}
Expand Down