@@ -229,20 +229,19 @@ pub async fn get_stats(
229
229
) -> Result < HttpResponse , StreamError > {
230
230
let stream_name = stream_name. into_inner ( ) ;
231
231
232
- if ! PARSEABLE . streams . contains ( & stream_name ) {
233
- // For query mode, if the stream not found in memory map,
234
- //check if it exists in the storage
235
- //create stream and schema from storage
236
- if PARSEABLE . options . mode != Mode :: Query
232
+ // For query mode, if the stream not found in memory map,
233
+ //check if it exists in the storage
234
+ //create stream and schema from storage
235
+ if ! PARSEABLE . streams . contains ( & stream_name )
236
+ && ( PARSEABLE . options . mode != Mode :: Query
237
237
|| matches ! (
238
238
PARSEABLE
239
239
. create_stream_and_schema_from_storage( & stream_name)
240
240
. await ,
241
241
Ok ( false ) | Err ( _)
242
- )
243
- {
244
- return Err ( StreamNotFound ( stream_name) . into ( ) ) ;
245
- }
242
+ ) )
243
+ {
244
+ return Err ( StreamNotFound ( stream_name) . into ( ) ) ;
246
245
}
247
246
248
247
if let Some ( stats) = params. get_stats ( & stream_name) {
@@ -325,17 +324,16 @@ pub async fn get_stats(
325
324
326
325
pub async fn get_stream_info ( stream_name : Path < String > ) -> Result < impl Responder , StreamError > {
327
326
let stream_name = stream_name. into_inner ( ) ;
328
- if !PARSEABLE . streams . contains ( & stream_name) {
329
- if PARSEABLE . options . mode != Mode :: Query
327
+ if !PARSEABLE . streams . contains ( & stream_name)
328
+ && ( PARSEABLE . options . mode != Mode :: Query
330
329
|| matches ! (
331
330
PARSEABLE
332
331
. create_stream_and_schema_from_storage( & stream_name)
333
332
. await ,
334
333
Ok ( false ) | Err ( _)
335
- )
336
- {
337
- return Err ( StreamNotFound ( stream_name) . into ( ) ) ;
338
- }
334
+ ) )
335
+ {
336
+ return Err ( StreamNotFound ( stream_name) . into ( ) ) ;
339
337
}
340
338
let storage = PARSEABLE . storage . get_object_store ( ) ;
341
339
// if first_event_at is not found in memory map, check if it exists in the storage
@@ -436,20 +434,19 @@ pub async fn put_stream_hot_tier(
436
434
pub async fn get_stream_hot_tier ( stream_name : Path < String > ) -> Result < impl Responder , StreamError > {
437
435
let stream_name = stream_name. into_inner ( ) ;
438
436
439
- if ! PARSEABLE . streams . contains ( & stream_name ) {
440
- // For query mode, if the stream not found in memory map,
441
- //check if it exists in the storage
442
- //create stream and schema from storage
443
- if PARSEABLE . options . mode != Mode :: Query
437
+ // For query mode, if the stream not found in memory map,
438
+ //check if it exists in the storage
439
+ //create stream and schema from storage
440
+ if ! PARSEABLE . streams . contains ( & stream_name )
441
+ && ( PARSEABLE . options . mode != Mode :: Query
444
442
|| matches ! (
445
443
PARSEABLE
446
444
. create_stream_and_schema_from_storage( & stream_name)
447
445
. await ,
448
446
Ok ( false ) | Err ( _)
449
- )
450
- {
451
- return Err ( StreamNotFound ( stream_name) . into ( ) ) ;
452
- }
447
+ ) )
448
+ {
449
+ return Err ( StreamNotFound ( stream_name) . into ( ) ) ;
453
450
}
454
451
455
452
let Some ( hot_tier_manager) = HotTierManager :: global ( ) else {
0 commit comments