Set default busy timeout to 5 seconds

This commit is contained in:
John Gallagher 2014-12-23 12:26:57 -05:00
parent ba1f648679
commit 05b03ae2ce

View File

@ -320,12 +320,19 @@ impl InnerSqliteConnection {
SqliteError{ code: r, SqliteError{ code: r,
message: ffi::code_to_str(r).to_string() } message: ffi::code_to_str(r).to_string() }
} else { } else {
let e = SqliteError::from_handle(db, r);
ffi::sqlite3_close(db); ffi::sqlite3_close(db);
SqliteError::from_handle(db, r) e
}; };
return Err(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 }) Ok(InnerSqliteConnection{ db: db })
}) })
} }