Skip to content

Commit

Permalink
Set default busy timeout to 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
hydhknn committed Dec 23, 2014
1 parent ba1f648 commit 05b03ae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
})
}
Expand Down

0 comments on commit 05b03ae

Please sign in to comment.