indexer: Actually commit the transaction that resets the dead flag
This commit is contained in:
parent
c67091f096
commit
9ff6bfc93f
2 changed files with 6 additions and 5 deletions
|
|
@ -226,15 +226,17 @@ fn index_pkg<T: postgres::GenericClient>(tr: &mut T, mut opt: PkgOpt, pkgid: i32
|
|||
|
||||
pub fn pkg<T>(conn: &mut T, opt: PkgOpt) where T: postgres::GenericClient {
|
||||
let mut tr = conn.transaction().unwrap();
|
||||
let pkg = insert_pkg(&mut tr, &opt);
|
||||
|
||||
let (pkgid,verid) = match insert_pkg(&mut tr, &opt) { Some(x) => x, None => return };
|
||||
if unsafe { DRY_RUN } {
|
||||
return;
|
||||
}
|
||||
|
||||
if let Err(e) = index_pkg(&mut tr, opt, pkgid, verid) {
|
||||
error!("Error reading package: {}", e);
|
||||
return;
|
||||
if let Some((pkgid,verid)) = pkg {
|
||||
if let Err(e) = index_pkg(&mut tr, opt, pkgid, verid) {
|
||||
error!("Error reading package: {}", e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(e) = tr.commit() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use std::str::FromStr;
|
||||
use std::io::{Read,BufRead,BufReader,Result};
|
||||
use std::collections::HashSet;
|
||||
use regex::Regex;
|
||||
use chrono::NaiveDateTime;
|
||||
use postgres;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue