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} ;
2
1
use std:: path:: { Path , PathBuf } ;
3
2
use std:: sync:: atomic:: { AtomicBool , Ordering } ;
4
3
use std:: sync:: Arc ;
@@ -88,18 +87,6 @@ impl<W: Wal + Send + 'static> CoreConnection<W> {
88
87
config. max_row_size as i32 ,
89
88
) ;
90
89
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
-
103
90
let canceled = Arc :: new ( AtomicBool :: new ( false ) ) ;
104
91
105
92
conn. progress_handler ( 100 , {
Original file line number Diff line number Diff line change @@ -383,6 +383,7 @@ where
383
383
}
384
384
retry = match connection_maker. untracked ( ) . await {
385
385
Ok ( conn) => {
386
+ conn. with_raw ( |c| c. busy_timeout ( std:: time:: Duration :: from_secs ( 5 ) ) ) ?;
386
387
if let Err ( e) = conn. vacuum_if_needed ( ) . await {
387
388
tracing:: warn!( "vacuum failed: {}" , e) ;
388
389
}
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ impl<W: Wal> Connection<W> {
266
266
}
267
267
}
268
268
269
- conn. busy_timeout ( std:: time:: Duration :: from_secs ( 5000 ) ) ?;
269
+ conn. busy_timeout ( std:: time:: Duration :: from_millis ( 100 ) ) ?;
270
270
271
271
conn
272
272
} ;
You can’t perform that action at this time.
0 commit comments