File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ use storage::lsm;
77/// A LSM configuration
88/// # Arguments
99/// * `flush_threshold` - The number of bytes to flush before flushing to disk
10+ /// * `detect_exit_signals` - Whether or not to detect exit signals (SIGTERM, SIGHUP, etc.)
1011#[ derive( Clone ) ]
1112pub struct LsmConfig {
1213 pub flush_threshold : Size ,
14+ pub detect_exit_signals : bool ,
1315}
1416
1517/// A DustData configuration
@@ -154,7 +156,9 @@ impl DustData {
154156 sstable_path : path. to_str ( ) . unwrap ( ) . to_string ( ) ,
155157 } ) ;
156158
157- lsm. handle_ctrlc ( ) ;
159+ if configuration. lsm_config . detect_exit_signals {
160+ lsm. handle_ctrlc ( ) ;
161+ }
158162
159163 Self {
160164 lsm,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ mod dustdata_tests {
2727 verbose : true ,
2828 path : "./test_data/dustdata" . to_string ( ) ,
2929 lsm_config : LsmConfig {
30+ detect_exit_signals : false ,
3031 flush_threshold : Size :: Megabytes ( 128 ) ,
3132 } ,
3233 }
You can’t perform that action at this time.
0 commit comments