@@ -7,7 +7,9 @@ use crate::rpc_call;
77use crate :: server:: bootstrap:: get_client_session;
88use crate :: server:: event:: journal:: JournalReader ;
99use crate :: server:: event:: streamer:: EventFilter ;
10- use crate :: transfer:: messages:: { FromClientMessage , StreamEvents , ToClientMessage } ;
10+ use crate :: transfer:: messages:: {
11+ FromClientMessage , StreamEvents , StreamEventsMode , ToClientMessage ,
12+ } ;
1113use anyhow:: anyhow;
1214use clap:: { Parser , ValueHint } ;
1315use std:: io:: { BufWriter , Write } ;
@@ -61,24 +63,19 @@ struct ExportOpts {
6163pub async fn command_journal ( gsettings : & GlobalSettings , opts : JournalOpts ) -> anyhow:: Result < ( ) > {
6264 match opts. command {
6365 JournalCommand :: Export ( opts) => export_json ( opts) ,
64- JournalCommand :: Replay => stream_json ( gsettings, true , false ) . await ,
65- JournalCommand :: Stream => stream_json ( gsettings, true , true ) . await ,
66+ JournalCommand :: Replay => stream_json ( gsettings, StreamEventsMode :: PastEvents ) . await ,
67+ JournalCommand :: Stream => stream_json ( gsettings, StreamEventsMode :: PastAndLiveEvents ) . await ,
6668 JournalCommand :: Prune => prune_journal ( gsettings) . await ,
6769 JournalCommand :: Flush => flush_journal ( gsettings) . await ,
6870 }
6971}
7072
71- async fn stream_json (
72- gsettings : & GlobalSettings ,
73- past_events : bool ,
74- live_events : bool ,
75- ) -> anyhow:: Result < ( ) > {
73+ async fn stream_json ( gsettings : & GlobalSettings , mode : StreamEventsMode ) -> anyhow:: Result < ( ) > {
7674 let mut connection = get_client_session ( gsettings. server_directory ( ) ) . await ?;
7775 connection
7876 . connection ( )
7977 . send ( FromClientMessage :: StreamEvents ( StreamEvents {
80- past_events,
81- live_events,
78+ mode,
8279 enable_worker_overviews : false ,
8380 filter : EventFilter :: all_events ( ) ,
8481 } ) )
0 commit comments