formating

This commit is contained in:
2023-07-21 20:15:57 +02:00
parent 0ddbb21f52
commit cb7b62a092
3 changed files with 4 additions and 11 deletions

View File

@@ -6,11 +6,10 @@
pub mod influx;
pub mod postgres;
// random functions for mqtt
// random functions for mqtt
pub mod mqtt;
pub mod unit_conversion;
// Commonly used types across the services
mod types {
pub mod mac; // deprecated for the time being.

View File

@@ -1,14 +1,10 @@
use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
use diesel::prelude::*;
use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
pub type DbConn = diesel::pg::PgConnection;
// pub type DbPooledConn = PooledConnection<ConnectionManager<PgConnection>>;
pub type DbPool = Pool<ConnectionManager<PgConnection>>;
pub struct DbPooledConn(pub PooledConnection<ConnectionManager<PgConnection>>);
pub fn establish_connection() -> DbConn {
let database_url = dotenv::var("DATABASE_URL").expect("DATABASE_URL must be set");
PgConnection::establish(&database_url)
@@ -26,4 +22,4 @@ impl std::ops::Deref for DbPooledConn {
fn deref(&self) -> &Self::Target {
&self.0
}
}
}

View File

@@ -3,9 +3,7 @@ use futures::stream::StreamExt;
mod handler;
mod position_solver;
use kairo_common::mqtt::for_async::{
get_mqtt_cli_and_stream, mqtt_cli_reconnect, mqtt_subscribe,
};
use kairo_common::mqtt::for_async::{get_mqtt_cli_and_stream, mqtt_cli_reconnect, mqtt_subscribe};
#[tokio::main]
async fn main() {