Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a new error type for ObjectStorage api #45

Merged
merged 4 commits into from
Aug 18, 2022
Merged
Changes from 1 commit
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
12 changes: 5 additions & 7 deletions server/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,12 @@ impl STREAM_INFO {
.and_then(parse_string)
.map_err(|_| Error::SchemaNotInStore(stream.name.to_owned()));

let metadata = match (alert_config, schema) {
(Ok(alert_config), Ok(schema)) => LogStreamMetadata {
schema,
alert_config,
..Default::default()
},
_ => continue,
let metadata = LogStreamMetadata {
schema: schema.unwrap_or_default(),
alert_config: alert_config.unwrap_or_default(),
Copy link
Contributor Author

@trueleo trueleo Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of returning or not adding metadata to stream we set it to empty string for now. This allows first event to not fail in case parseable was restarted just after adding a stream.

This behaviour could be changed later by using Option type in LogStreamMetadata.

..Default::default()
};

let mut map = self.write().unwrap();
map.insert(stream.name.clone(), metadata);
}
Expand Down