Make SQLite timeout available to user config.

This commit is contained in:
Edu4rdSHL 2021-04-17 00:46:07 -05:00
parent ce44bf679c
commit d17690f960
No known key found for this signature in database
GPG key ID: 3A574A4009F553E5
2 changed files with 8 additions and 1 deletions

View file

@ -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
}

View file

@ -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