Skip to content

Commit

Permalink
db-ingest: Remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
raimannma committed Oct 11, 2024
1 parent 27a7b10 commit 43930bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
13 changes: 3 additions & 10 deletions db-ingest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async fn main() {
});
}
Err(e) => {
println!("Error receiving message: {:?}", e);
error!("Error receiving message: {:?}", e);
continue;
}
}
Expand All @@ -54,18 +54,11 @@ async fn main() {
async fn process_message(message: Delivery) {
match try_process_message(&message).await {
Ok(_) => {
debug!(
"Message processed successfully: {:?}",
String::from_utf8_lossy(&message.data)
);
debug!("Message processed successfully");
message.ack(BasicAckOptions::default()).await.unwrap();
}
Err(e) => {
error!(
"Error processing message {:?} -> {:?}",
String::from_utf8_lossy(&message.data),
e
);
error!("Error processing message: {:?}", e);
message.reject(BasicRejectOptions::default()).await.unwrap();
}
}
Expand Down
10 changes: 0 additions & 10 deletions db-ingest/src/parsers/active_matches_json_lines_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::models::file_data::FileData;
use crate::models::file_type::FileType;
use crate::models::parse_result::ParseResult;
use crate::parsers::parser::Parser;
use log::{debug, warn};

#[derive(Default, Debug)]
pub struct ActiveMatchesJsonLinesParser;
Expand All @@ -17,15 +16,6 @@ impl Parser<Vec<Vec<ActiveMatch>>> for ActiveMatchesJsonLinesParser {
data: &[u8],
) -> Result<ParseResult<Vec<Vec<ActiveMatch>>>, ParseError> {
let data_str = String::from_utf8_lossy(data);
debug!("Data: {}", data_str);
for line in data_str.lines() {
match serde_json::from_str::<Vec<ActiveMatch>>(line) {
Ok(_) => {}
Err(e) => {
warn!("Error parsing line: {}", e);
}
}
}
let parsed_data = data_str
.lines()
.filter_map(|l| serde_json::from_str::<Vec<ActiveMatch>>(l).ok())
Expand Down

0 comments on commit 43930bf

Please sign in to comment.