@@ -50,16 +50,20 @@ pub fn build_graphs(
5050 match & config. file_type {
5151 FileType :: Json => {
5252 let mut parser = dom:: Parser :: default ( ) ;
53- read_file ( config, |line| {
54- let row = parse_json_line ( line, & mut parser, & config. columns ) ;
55- entity_processor. process_row ( & row) ;
56- } ) ;
53+ for input in config. input . iter ( ) {
54+ read_file ( input, config. log_every_n as u64 , |line| {
55+ let row = parse_json_line ( line, & mut parser, & config. columns ) ;
56+ entity_processor. process_row ( & row) ;
57+ } ) ;
58+ }
5759 }
5860 FileType :: Tsv => {
59- read_file ( config, |line| {
60- let row = parse_tsv_line ( line) ;
61- entity_processor. process_row ( & row) ;
62- } ) ;
61+ for input in config. input . iter ( ) {
62+ read_file ( input, config. log_every_n as u64 , |line| {
63+ let row = parse_tsv_line ( line) ;
64+ entity_processor. process_row ( & row) ;
65+ } ) ;
66+ }
6367 }
6468 }
6569
@@ -77,11 +81,11 @@ pub fn build_graphs(
7781}
7882
7983/// Read file line by line. Pass every valid line to handler for parsing.
80- fn read_file < F > ( config : & Configuration , mut line_handler : F )
84+ fn read_file < F > ( filepath : & str , log_every : u64 , mut line_handler : F )
8185where
8286 F : FnMut ( & str ) ,
8387{
84- let input_file = File :: open ( & config . input ) . expect ( "Can't open file" ) ;
88+ let input_file = File :: open ( filepath ) . expect ( "Can't open file" ) ;
8589 let mut buffered = BufReader :: new ( input_file) ;
8690
8791 let mut line_number = 1u64 ;
@@ -104,7 +108,7 @@ where
104108 // clear to reuse the buffer
105109 line. clear ( ) ;
106110
107- if line_number % config . log_every_n as u64 == 0 {
111+ if line_number % log_every == 0 {
108112 info ! ( "Number of lines processed: {}" , line_number) ;
109113 }
110114
0 commit comments