mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 07:09:20 +08:00
Set default busy timeout to 5 seconds
This commit is contained in:
parent
ba1f648679
commit
05b03ae2ce
@ -320,12 +320,19 @@ impl InnerSqliteConnection {
|
||||
SqliteError{ code: r,
|
||||
message: ffi::code_to_str(r).to_string() }
|
||||
} else {
|
||||
let e = SqliteError::from_handle(db, r);
|
||||
ffi::sqlite3_close(db);
|
||||
SqliteError::from_handle(db, r)
|
||||
e
|
||||
};
|
||||
|
||||
return Err(e);
|
||||
}
|
||||
let r = ffi::sqlite3_busy_timeout(db, 5000);
|
||||
if r != ffi::SQLITE_OK {
|
||||
let e = SqliteError::from_handle(db, r);
|
||||
ffi::sqlite3_close(db);
|
||||
return Err(e);
|
||||
}
|
||||
Ok(InnerSqliteConnection{ db: db })
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user