File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ use std::time::Duration;
26
26
27
27
include ! ( concat!( env!( "OUT_DIR" ) , "/cppdriver_compression_types.rs" ) ) ;
28
28
29
+ // According to `cassandra.h` the default CPP driver's
30
+ // - consistency for statements is LOCAL_ONE,
31
+ // - request client timeout is 12000 millis.
32
+ const DEFAULT_CONSISTENCY : Consistency = Consistency :: LocalOne ;
33
+ const DEFAULT_REQUEST_TIMEOUT_MILLIS : u64 = 12000 ;
34
+
29
35
#[ derive( Clone , Debug ) ]
30
36
pub ( crate ) struct LoadBalancingConfig {
31
37
pub ( crate ) token_awareness_enabled : bool ,
@@ -115,12 +121,9 @@ pub fn build_session_builder(
115
121
116
122
#[ no_mangle]
117
123
pub unsafe extern "C" fn cass_cluster_new ( ) -> * mut CassCluster {
118
- // According to `cassandra.h` the default CPP driver's
119
- // - consistency for statements is LOCAL_ONE,
120
- // - request client timeout is 12000 millis.
121
124
let default_execution_profile_builder = ExecutionProfileBuilder :: default ( )
122
- . consistency ( Consistency :: LocalOne )
123
- . request_timeout ( Some ( Duration :: from_millis ( 12000 ) ) ) ;
125
+ . consistency ( DEFAULT_CONSISTENCY )
126
+ . request_timeout ( Some ( Duration :: from_millis ( DEFAULT_REQUEST_TIMEOUT_MILLIS ) ) ) ;
124
127
125
128
Box :: into_raw ( Box :: new ( CassCluster {
126
129
session_builder : SessionBuilder :: new ( ) ,
You can’t perform that action at this time.
0 commit comments