File tree 6 files changed +34
-8
lines changed
compressor_integration_tests
6 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,5 @@ features = ["extension-module","abi3-py36"]
32
32
33
33
[features ]
34
34
default = [" jemalloc" ]
35
- jemalloc = []
35
+ jemalloc = []
36
+ no-progress-bars = []
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ postgres-openssl = "0.5.0"
14
14
jemallocator = " 0.3.2"
15
15
rand = " 0.8.0"
16
16
serial_test = " 0.5.1"
17
- synapse_compress_state = { path = " ../" }
17
+ synapse_compress_state = { path = " ../" , features = [ " no-progress-bars " ] }
18
18
env_logger = { version = " 0.9.0" , git = " https://github.com/TilCreator/env_logger" , branch = " fix_pipe" }
19
19
log = " 0.4.14"
20
20
log-panics = " 2.0.0"
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ openssl = "0.10.32"
12
12
postgres = " 0.19.0"
13
13
postgres-openssl = " 0.5.0"
14
14
rand = " 0.8.0"
15
- synapse_compress_state = { path = " ../" }
15
+ synapse_compress_state = { path = " ../" , features = [ " no-progress-bars " ] }
16
16
auto_compressor = { path = " ../auto_compressor/" }
17
17
env_logger = " 0.9.0"
18
18
log = " 0.4.14"
Original file line number Diff line number Diff line change @@ -181,7 +181,12 @@ impl<'a> Compressor<'a> {
181
181
panic ! ( "Can only call `create_new_tree` once" ) ;
182
182
}
183
183
184
- let pb = ProgressBar :: new ( self . original_state_map . len ( ) as u64 ) ;
184
+ let pb: ProgressBar ;
185
+ if cfg ! ( feature = "no-progress-bars" ) {
186
+ pb = ProgressBar :: hidden ( ) ;
187
+ } else {
188
+ pb = ProgressBar :: new ( self . original_state_map . len ( ) as u64 ) ;
189
+ }
185
190
pb. set_style (
186
191
ProgressStyle :: default_bar ( ) . template ( "[{elapsed_precise}] {bar} {pos}/{len} {msg}" ) ,
187
192
) ;
Original file line number Diff line number Diff line change @@ -369,7 +369,12 @@ fn get_initial_data_from_db(
369
369
// Copy the data from the database into a map
370
370
let mut state_group_map: BTreeMap < i64 , StateGroupEntry > = BTreeMap :: new ( ) ;
371
371
372
- let pb = ProgressBar :: new_spinner ( ) ;
372
+ let pb: ProgressBar ;
373
+ if cfg ! ( feature = "no-progress-bars" ) {
374
+ pb = ProgressBar :: hidden ( ) ;
375
+ } else {
376
+ pb = ProgressBar :: new_spinner ( ) ;
377
+ }
373
378
pb. set_style (
374
379
ProgressStyle :: default_spinner ( ) . template ( "{spinner} [{elapsed}] {pos} rows retrieved" ) ,
375
380
) ;
@@ -529,7 +534,12 @@ pub fn send_changes_to_db(
529
534
println ! ( "Writing changes..." ) ;
530
535
531
536
// setup the progress bar
532
- let pb = ProgressBar :: new ( old_map. len ( ) as u64 ) ;
537
+ let pb: ProgressBar ;
538
+ if cfg ! ( feature = "no-progress-bars" ) {
539
+ pb = ProgressBar :: hidden ( ) ;
540
+ } else {
541
+ pb = ProgressBar :: new ( old_map. len ( ) as u64 ) ;
542
+ }
533
543
pb. set_style (
534
544
ProgressStyle :: default_bar ( ) . template ( "[{elapsed_precise}] {bar} {pos}/{len} {msg}" ) ,
535
545
) ;
Original file line number Diff line number Diff line change @@ -487,7 +487,12 @@ fn output_sql(
487
487
488
488
println ! ( "Writing changes..." ) ;
489
489
490
- let pb = ProgressBar :: new ( old_map. len ( ) as u64 ) ;
490
+ let pb: ProgressBar ;
491
+ if cfg ! ( feature = "no-progress-bars" ) {
492
+ pb = ProgressBar :: hidden ( ) ;
493
+ } else {
494
+ pb = ProgressBar :: new ( old_map. len ( ) as u64 ) ;
495
+ }
491
496
pb. set_style (
492
497
ProgressStyle :: default_bar ( ) . template ( "[{elapsed_precise}] {bar} {pos}/{len} {msg}" ) ,
493
498
) ;
@@ -597,7 +602,12 @@ fn check_that_maps_match(
597
602
) {
598
603
println ! ( "Checking that state maps match..." ) ;
599
604
600
- let pb = ProgressBar :: new ( old_map. len ( ) as u64 ) ;
605
+ let pb: ProgressBar ;
606
+ if cfg ! ( feature = "no-progress-bars" ) {
607
+ pb = ProgressBar :: hidden ( ) ;
608
+ } else {
609
+ pb = ProgressBar :: new ( old_map. len ( ) as u64 ) ;
610
+ }
601
611
pb. set_style (
602
612
ProgressStyle :: default_bar ( ) . template ( "[{elapsed_precise}] {bar} {pos}/{len} {msg}" ) ,
603
613
) ;
You can’t perform that action at this time.
0 commit comments