mirror of
https://github.com/edu4rdshl/rusnapshot.git
synced 2026-07-17 23:24:55 +00:00
Make SQLite timeout available to user config.
This commit is contained in:
parent
ce44bf679c
commit
d17690f960
2 changed files with 8 additions and 1 deletions
|
|
@ -42,8 +42,9 @@ pub fn get_args() -> Args {
|
|||
} else {
|
||||
match sqlite::open(&db_file_path) {
|
||||
Ok(mut connection) => {
|
||||
let timeout = value_t!(matches, "timeout", usize).unwrap_or_else(|_| 5000);
|
||||
connection
|
||||
.set_busy_timeout(5000)
|
||||
.set_busy_timeout(timeout)
|
||||
.expect("Failed to set database timeout");
|
||||
connection
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,12 @@ args:
|
|||
takes_value: true
|
||||
multiple: false
|
||||
|
||||
- timeout:
|
||||
help: "Time in milliseconds until SQLite can return a timeout (Do not touch if you don't know what you are doing). Default: 5000"
|
||||
long: timeout
|
||||
takes_value: true
|
||||
multiple: false
|
||||
|
||||
- create-snapshot:
|
||||
help: Create an snapshot.
|
||||
long: cr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue