Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds logs for debugging #29

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
9 changes: 6 additions & 3 deletions lib/worker/src/db/publications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ pub async fn find_job_cache_path_by_cid(pool: &PgPool, cid: Cid) -> Result<Optio
)
.as_str(),
)
.map(|row: PgRow| {
row.try_get("cache_path")
.map_or(None, |v| Some(CachePath::from(v)))
.map(|row: PgRow| match row.try_get("cache_path") {
Ok(v) => Some(CachePath::from(v)),
Err(err) => {
log::error!("try get cache_path, err = {:?}", err);
None
}
})
.fetch_one(pool)
.await
Expand Down
3 changes: 2 additions & 1 deletion lib/worker/src/routes/vaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub async fn find_event_by_id(
pool: PgPool,
gcs_client: GcsClient,
) -> Result<Box<dyn warp::Reply>, 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(
Expand Down Expand Up @@ -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<u8> = Vec::new();
return Ok(Box::new(with_status(json(&empty), StatusCode::NOT_FOUND)));
}
Expand Down
Loading