aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/api_server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/api_server.rs')
-rw-r--r--rust/src/api_server.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs
index 59836e31..cac222e6 100644
--- a/rust/src/api_server.rs
+++ b/rust/src/api_server.rs
@@ -7,6 +7,11 @@ use futures::{self, Future};
use std::collections::HashMap;
+use self::models::*;
+use diesel;
+use diesel::prelude::*;
+use iron_diesel_middleware::DieselPooledConnection;
+
use swagger;
use fatcat_api::models;
@@ -28,11 +33,16 @@ impl Api for Server {
context: &Context,
) -> Box<Future<Item = ContainerIdGetResponse, Error = ApiError> + Send> {
let context = context.clone();
+ let con: DieselPooledConnection<diesel::pg::PgConnection> = req.db_conn();
println!(
"container_id_get(\"{}\") - X-Span-ID: {:?}",
id,
context.x_span_id.unwrap_or(String::from("<none>")).clone()
);
+ println!(
+ "container count: {}",
+ containers.count().load(&con).expect("DB Error"),
+ );
Box::new(futures::failed("Generic failure".into()))
}