From 803e845c7e90226e43f962e0f74ad41c999c93bb Mon Sep 17 00:00:00 2001 From: Bruno Calza Date: Mon, 19 Feb 2024 15:32:24 -0300 Subject: [PATCH] adds logs for debugging [staging] Signed-off-by: Bruno Calza --- lib/worker/src/db/publications.rs | 9 ++++++--- lib/worker/src/routes/vaults.rs | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/worker/src/db/publications.rs b/lib/worker/src/db/publications.rs index c458dea..6974ff6 100644 --- a/lib/worker/src/db/publications.rs +++ b/lib/worker/src/db/publications.rs @@ -184,9 +184,12 @@ pub async fn find_job_cache_path_by_cid(pool: &PgPool, cid: Cid) -> Result Some(CachePath::from(v)), + Err(err) => { + log::error!("try get cache_path, err = {:?}", err); + None + } }) .fetch_one(pool) .await diff --git a/lib/worker/src/routes/vaults.rs b/lib/worker/src/routes/vaults.rs index ad9e304..8449a85 100644 --- a/lib/worker/src/routes/vaults.rs +++ b/lib/worker/src/routes/vaults.rs @@ -40,7 +40,7 @@ pub async fn find_event_by_id( pool: PgPool, gcs_client: GcsClient, ) -> Result, Infallible> { - let cid: Cid = match path.try_into() { + let cid: Cid = match path.clone().try_into() { Ok(v) => v, Err(err) => { return Ok(Box::new(with_status( @@ -68,6 +68,7 @@ pub async fn find_event_by_id( let cache_path = match cache_path { Some(path) => path, None => { + log::info!("cache path is none, cid = {}", path); let empty: Vec = Vec::new(); return Ok(Box::new(with_status(json(&empty), StatusCode::NOT_FOUND))); }