mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-04-22 19:45:41 -04:00
fix SQLite3 integrity check
This commit is contained in:
parent
fdb6603b5e
commit
ed521521a4
@ -60,10 +60,16 @@ pub fn run(conn: &mut rusqlite::Connection, opts: &Options) -> Result<i32, Error
|
|||||||
let mut printed_error = false;
|
let mut printed_error = false;
|
||||||
|
|
||||||
info!("Checking SQLite database integrity...");
|
info!("Checking SQLite database integrity...");
|
||||||
if let Err(e) = conn.execute("pragma check_integrity", params![]) {
|
{
|
||||||
error!("Database integrity error: {}", e);
|
let mut stmt = conn.prepare("pragma integrity_check")?;
|
||||||
|
let mut rows = stmt.query(params![])?;
|
||||||
|
while let Some(row) = rows.next()? {
|
||||||
|
let e: String = row.get(0)?;
|
||||||
|
if e == "ok" { continue; }
|
||||||
|
error!("{}", e);
|
||||||
printed_error = true;
|
printed_error = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
info!("...done");
|
info!("...done");
|
||||||
|
|
||||||
// Compare stated schema version.
|
// Compare stated schema version.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user