formatting

This commit is contained in:
Robin Appelman 2020-06-18 14:51:06 +02:00
commit 491a0daae4
2 changed files with 20 additions and 18 deletions

View file

@ -211,6 +211,7 @@ pub async fn store_log(pool: &PgPool, id: i32, log: &NormalizedLog) -> Result<()
.id; .id;
for class in &player.class_stats { for class in &player.class_stats {
if class.class != Class::Unknown {
let class_stat_id: i32 = sqlx::query!( let class_stat_id: i32 = sqlx::query!(
"INSERT INTO class_stats(player_id, type, time, kills, deaths, assists, dmg)\ "INSERT INTO class_stats(player_id, type, time, kills, deaths, assists, dmg)\
VALUES($1, $2, $3, $4, $5, $6, $7)\ VALUES($1, $2, $3, $4, $5, $6, $7)\
@ -243,6 +244,7 @@ pub async fn store_log(pool: &PgPool, id: i32, log: &NormalizedLog) -> Result<()
} }
} }
} }
}
tx.commit().await?; tx.commit().await?;

View file

@ -23,7 +23,7 @@ async fn main() -> Result<(), MainError> {
let from = get_max_stored_log(&pool).await?; let from = get_max_stored_log(&pool).await?;
for id in (from + 1)..=max { for id in (from + 1)..=max {
println!("{}", id); print!("{} ", id);
if let Some(log) = get_log(&raw_pool, id).await? { if let Some(log) = get_log(&raw_pool, id).await? {
println!("{}", log.info.map); println!("{}", log.info.map);
store_log(&pool, id, &log).await?; store_log(&pool, id, &log).await?;