File tree Expand file tree Collapse file tree 3 files changed +2
-14
lines changed
Expand file tree Collapse file tree 3 files changed +2
-14
lines changed Original file line number Diff line number Diff line change 1- use std:: ffi:: { c_int, c_void} ;
21use std:: path:: { Path , PathBuf } ;
32use std:: sync:: atomic:: { AtomicBool , Ordering } ;
43use std:: sync:: Arc ;
@@ -88,18 +87,6 @@ impl<W: Wal + Send + 'static> CoreConnection<W> {
8887 config. max_row_size as i32 ,
8988 ) ;
9089
91- unsafe {
92- const MAX_RETRIES : c_int = 8 ;
93- extern "C" fn do_nothing ( _: * mut c_void , n : c_int ) -> c_int {
94- ( n < MAX_RETRIES ) as _
95- }
96- libsql_sys:: ffi:: sqlite3_busy_handler (
97- conn. handle ( ) ,
98- Some ( do_nothing) ,
99- std:: ptr:: null_mut ( ) ,
100- ) ;
101- }
102-
10390 let canceled = Arc :: new ( AtomicBool :: new ( false ) ) ;
10491
10592 conn. progress_handler ( 100 , {
Original file line number Diff line number Diff line change @@ -383,6 +383,7 @@ where
383383 }
384384 retry = match connection_maker. untracked ( ) . await {
385385 Ok ( conn) => {
386+ conn. with_raw ( |c| c. busy_timeout ( std:: time:: Duration :: from_secs ( 5 ) ) ) ?;
386387 if let Err ( e) = conn. vacuum_if_needed ( ) . await {
387388 tracing:: warn!( "vacuum failed: {}" , e) ;
388389 }
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ impl<W: Wal> Connection<W> {
266266 }
267267 }
268268
269- conn. busy_timeout ( std:: time:: Duration :: from_secs ( 5000 ) ) ?;
269+ conn. busy_timeout ( std:: time:: Duration :: from_millis ( 100 ) ) ?;
270270
271271 conn
272272 } ;
You can’t perform that action at this time.
0 commit comments