.route("/metrics", web::get().to(metrics))
})
.bind((bind, port as u16))
- .expect(&format!("Cannot bind to {}:{}", bind, port))
+ .unwrap_or_else(|_| panic!("Cannot bind to {}:{}", bind, port))
.run();
if let Err(err) = server.await {
.register(Box::new(metrics.available.clone()))
.unwrap();
- return metrics;
+ metrics
}
async fn collect_db_pool_metrics(context: &PromContext) {
- let pool_status = context.lemmy.pool().status();
+ let pool_status = context.lemmy.inner_pool().status();
context
.db_pool_metrics
.max_size