Skip to content

Commit

Permalink
fix: add /query endpoint on Ingest Server
Browse files Browse the repository at this point in the history
  • Loading branch information
Eshanatnight committed Mar 8, 2024
1 parent 559ecf5 commit 6767b9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions server/src/handlers/http/modal/ingest_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ impl IngestServer {
.service(
// Base path "{url}/api/v1"
web::scope(&base_path())
.service(Server::get_query_factory())
.service(Server::get_ingest_factory())
.service(Self::logstream_api()),
)
Expand Down
16 changes: 13 additions & 3 deletions server/src/storage/object_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,20 @@ pub trait ObjectStorage: Sync + 'static {
Ok(data) => data,
Err(_) => {
// ! this is hard coded for now
let bytes = self.get_object(&RelativePathBuf::from_iter([stream_name, STREAM_METADATA_FILE_NAME])).await?;
self.put_stream_manifest(stream_name, &serde_json::from_slice::<ObjectStoreFormat>(&bytes).expect("parseable config is valid json")).await?;
let bytes = self
.get_object(&RelativePathBuf::from_iter([
stream_name,
STREAM_METADATA_FILE_NAME,
]))
.await?;
self.put_stream_manifest(
stream_name,
&serde_json::from_slice::<ObjectStoreFormat>(&bytes)
.expect("parseable config is valid json"),
)
.await?;
bytes
},
}
};

Ok(serde_json::from_slice(&stream_metadata).expect("parseable config is valid json"))
Expand Down

0 comments on commit 6767b9b

Please sign in to comment.