Skip to content

Commit

Permalink
fix: readiness api to use correct JSON path (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eshanatnight authored Apr 12, 2024
1 parent c1c0861 commit 7e708bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions server/src/storage/object_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ pub trait ObjectStorage: Sync + 'static {
async fn get_latency(&self) -> Duration {
// It's Ok to `unwrap` here. The hardcoded value will always Result in
// an `Ok`.
let path = RelativePathBuf::from_path(PARSEABLE_METADATA_FILE_NAME).unwrap();

let path = parseable_json_path();
let start = Instant::now();
let _ = self.get_object(&path).await;
start.elapsed()
Expand Down
6 changes: 3 additions & 3 deletions server/src/storage/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ use crate::metrics::storage::{s3::REQUEST_RESPONSE_TIME, StorageMetrics};
use crate::storage::{LogStream, ObjectStorage, ObjectStorageError, PARSEABLE_ROOT_DIRECTORY};

use super::metrics_layer::MetricLayer;
use super::object_storage::parseable_json_path;
use super::{
ObjectStorageProvider, PARSEABLE_METADATA_FILE_NAME, SCHEMA_FILE_NAME,
STREAM_METADATA_FILE_NAME, STREAM_ROOT_DIRECTORY,
ObjectStorageProvider, SCHEMA_FILE_NAME, STREAM_METADATA_FILE_NAME, STREAM_ROOT_DIRECTORY,
};

// in bytes
Expand Down Expand Up @@ -533,7 +533,7 @@ impl ObjectStorage for S3 {
async fn check(&self) -> Result<(), ObjectStorageError> {
Ok(self
.client
.head(&PARSEABLE_METADATA_FILE_NAME.into())
.head(&to_object_store_path(&parseable_json_path()))
.await
.map(|_| ())?)
}
Expand Down

0 comments on commit 7e708bb

Please sign in to comment.