Skip to content

Commit 28e8884

Browse files
authored
Ignore empty alerts (#59)
1 parent 008c351 commit 28e8884

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/metadata.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,18 @@ impl STREAM_INFO {
148148
let alerts = storage
149149
.get_alerts(&stream.name)
150150
.await
151-
.map_err(|_| Error::AlertNotInStore(stream.name.to_owned()))?;
151+
.map_err(|_| Error::AlertNotInStore(stream.name.to_owned()));
152+
152153
let schema = storage
153154
.get_schema(&stream.name)
154155
.await
155156
.map_err(|e| e.into())
156157
.and_then(parse_string)
157158
.map_err(|_| Error::SchemaNotInStore(stream.name.to_owned()))?;
159+
158160
let metadata = LogStreamMetadata {
159161
schema,
160-
alerts,
162+
alerts: alerts.unwrap_or_default(),
161163
..Default::default()
162164
};
163165

0 commit comments

Comments
 (0)