From 570dd9aa6f6a808ab07605c703fc449a50d5b3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karolis=20Gudi=C5=A1kis?= Date: Wed, 6 Mar 2024 07:15:36 +0200 Subject: [PATCH] Testing --- dozer-ingestion/aerospike/src/connector.rs | 9 +++++++++ dozer-sink-oracle/src/lib.rs | 2 ++ 2 files changed, 11 insertions(+) diff --git a/dozer-ingestion/aerospike/src/connector.rs b/dozer-ingestion/aerospike/src/connector.rs index 344354ad57..7458ab6e4a 100644 --- a/dozer-ingestion/aerospike/src/connector.rs +++ b/dozer-ingestion/aerospike/src/connector.rs @@ -166,6 +166,15 @@ impl AerospikeConnector { Ok(HttpServer::new(move || { App::new() + .app_data(web::JsonConfig::default().error_handler(|err, _req| { + actix_web::error::InternalError::from_response( + "", + HttpResponse::BadRequest() + .content_type("application/json") + .body(format!(r#"{{"error":"{}"}}"#, err)), + ) + .into() + })) .app_data(web::Data::new(server_state.clone())) .service(healthcheck) .service(healthcheck_batch) diff --git a/dozer-sink-oracle/src/lib.rs b/dozer-sink-oracle/src/lib.rs index 0e62816b4e..1b5193b8a0 100644 --- a/dozer-sink-oracle/src/lib.rs +++ b/dozer-sink-oracle/src/lib.rs @@ -565,6 +565,7 @@ enum OpKind { impl OracleSink { fn exec_batch(&mut self) -> oracle::Result<()> { debug!("Executing batch of size {}", self.batch_params.len()); + let started = std::time::Instant::now(); let mut batch = self .conn .batch(&self.merge_statement, self.batch_params.len()) @@ -587,6 +588,7 @@ impl OracleSink { batch.append_row(&[])?; } batch.execute()?; + info!("Execution took {:?}", started.elapsed()); Ok(()) }