Skip to content

Commit

Permalink
db-ingest: Add error log
Browse files Browse the repository at this point in the history
  • Loading branch information
raimannma committed Oct 11, 2024
1 parent bcb01f4 commit 240bbd4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions db-ingest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use crate::parsers::active_matches_json_lines_parser::ActiveMatchesJsonLinesPars
use crate::parsers::metadata_content_parser::MetaDataContentParser;
use crate::parsers::metadata_parser::MetaDataParser;
use crate::parsers::parser::Parser;
use ::s3::request::ResponseData;
use futures_lite::StreamExt;
use lapin::message::Delivery;
use lapin::options::{BasicAckOptions, BasicRejectOptions};
use log::{debug, error, info};
use ::s3::request::ResponseData;
use std::path::Path;
use std::sync::Arc;
use tokio::sync::Semaphore;
Expand Down Expand Up @@ -86,6 +86,7 @@ async fn try_process_message(message: &Delivery) -> Result<(), ParseError> {
match process_file(&file_data, &file_content).await {
Ok(_) => Ok(()),
Err(e) => {
error!("Error processing file: {:?}", e);
let failed_path = get_failed_path(
&file_data.file_name,
file_data.file_type,
Expand Down Expand Up @@ -164,7 +165,7 @@ async fn process_metadata(
compressed,
&get_parsed_path(&file_data.file_name, result.file_type, result.compression),
)
.await?;
.await?;
let s3_path = file_data
.file_path
.to_str()
Expand Down Expand Up @@ -193,7 +194,7 @@ async fn process_metadata_content(
compressed,
&get_parsed_path(&file_data.file_name, result.file_type, result.compression),
)
.await?;
.await?;
let s3_path = file_data
.file_path
.to_str()
Expand Down Expand Up @@ -221,7 +222,7 @@ async fn process_active_matches(
compressed,
&get_parsed_path(&file_data.file_name, result.file_type, result.compression),
)
.await?;
.await?;
let s3_path = file_data
.file_path
.to_str()
Expand Down

0 comments on commit 240bbd4

Please sign in to comment.