Skip to content

Commit

Permalink
fix: borrow issue
Browse files Browse the repository at this point in the history
  • Loading branch information
byteZorvin committed Oct 11, 2024
1 parent e416c5b commit d42baa4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/orchestrator/src/jobs/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::str::FromStr;

use crate::jobs::{JobError, OtherError};

pub fn parse_string<T: FromStr>(value: String) -> Result<T, JobError>
pub fn parse_string<T: FromStr>(value: &String) -> Result<T, JobError>
where
T::Err: std::fmt::Display,
{
Expand Down
6 changes: 3 additions & 3 deletions crates/orchestrator/src/jobs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ pub async fn create_job(
KeyValue::new("job", format!("{:?}", job_item)),
];

ORCHESTRATOR_METRICS.block_gauge.record(parse_string(internal_id)?, &attributes);
ORCHESTRATOR_METRICS.block_gauge.record(parse_string(&internal_id)?, &attributes);
tracing::info!(log_type = "completed", category = "general", function_type = "create_job", block_no = %internal_id, "General create job completed for block");
Ok(())
}
Expand Down Expand Up @@ -262,7 +262,7 @@ pub async fn process_job(id: Uuid, config: Arc<Config>) -> Result<(), JobError>
KeyValue::new("job", format!("{:?}", job)),
];

ORCHESTRATOR_METRICS.block_gauge.record(parse_string(job.internal_id)?, &attributes);
ORCHESTRATOR_METRICS.block_gauge.record(parse_string(&job.internal_id)?, &attributes);
tracing::info!(log_type = "completed", category = "general", function_type = "process_job", block_no = %internal_id, "General process job completed for block");
Ok(())
}
Expand Down Expand Up @@ -395,7 +395,7 @@ pub async fn verify_job(id: Uuid, config: Arc<Config>) -> Result<(), JobError> {
KeyValue::new("job", format!("{:?}", job)),
];

ORCHESTRATOR_METRICS.block_gauge.record(parse_string(job.internal_id)?, &attributes);
ORCHESTRATOR_METRICS.block_gauge.record(parse_string(&job.internal_id)?, &attributes);
tracing::info!(log_type = "completed", category = "general", function_type = "verify_job", block_no = %internal_id, "General verify job completed for block");
Ok(())
}
Expand Down

0 comments on commit d42baa4

Please sign in to comment.