Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Bump sqlx to latest #2116

Merged
merged 1 commit into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 31 additions & 68 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions iml-services/iml-journal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

struct Row {
id: i32,
content_type_id: i32,
content_type_id: Option<i32>,
}

let row = sqlx::query_as!(Row,
Expand All @@ -97,8 +97,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
};

let content_type_id = match row.content_type_id.as_ref() {
Some(x) => *x,
None => {
tracing::warn!("Host '{}' content_type_id is unknown", host);
continue;
}
};

for x in xs.iter() {
execute_handlers(&x.message, row.id, row.content_type_id, &pool).await?;
execute_handlers(&x.message, row.id, content_type_id, &pool).await?;
}

num_rows += xs.len() as i64;
Expand Down