Skip to content

Commit

Permalink
update: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
heemankv committed Oct 24, 2024
1 parent fd8a0a8 commit c105c49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/orchestrator/src/jobs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub async fn create_job(
/// DB. It then adds the job to the verification queue.
#[tracing::instrument(skip(config), fields(category = "general", job, job_type, internal_id), ret, err)]
pub async fn process_job(id: Uuid, config: Arc<Config>) -> Result<(), JobError> {
let job: JobItem = get_job(id, config.clone()).await?;
let job = get_job(id, config.clone()).await?;
let internal_id = job.internal_id.clone();
tracing::info!(log_type = "starting", category = "general", function_type = "process_job", block_no = %internal_id, "General process job started for block");

Expand Down
8 changes: 4 additions & 4 deletions crates/orchestrator/src/tests/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ async fn implement_api_server(api_server_type: ConfigType, config: Arc<Config>)
let (api_server_url, listener) = get_server_url().await;
let app = Router::new().merge(router);

if let Err(e) = axum::serve(listener, app).await {
tracing::error!(service = "orchestrator", error = %e, "Server failed to start");
panic!("Failed to start axum server: {}", e);
}
tokio::spawn(async move {
axum::serve(listener, app).await.expect("Failed to start axum server");
});

Some(api_server_url)
} else {
panic!(concat!("Mock client is not a ", stringify!($client_type)));
Expand Down
2 changes: 2 additions & 0 deletions crates/orchestrator/src/tests/server/job_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ async fn test_trigger_process_job(#[future] setup_trigger: (SocketAddr, Arc<Conf
assert_eq!(response.status(), 200);
assert_eq!(job_fetched.id, job_item.id);
assert_eq!(job_fetched.version, 2);
assert_eq!(job_fetched.status, JobStatus::PendingVerification);
} else {
panic!("Could not get job from database")
}
Expand Down Expand Up @@ -112,6 +113,7 @@ async fn test_trigger_verify_job(#[future] setup_trigger: (SocketAddr, Arc<Confi
assert_eq!(response.status(), 200);
assert_eq!(job_fetched.id, job_item.id);
assert_eq!(job_fetched.version, 1);
assert_eq!(job_fetched.status, JobStatus::Completed);
} else {
panic!("Could not get job from database")
}
Expand Down

0 comments on commit c105c49

Please sign in to comment.