formating
This commit is contained in:
@@ -10,7 +10,6 @@ pub mod postgres;
|
||||
pub mod mqtt;
|
||||
pub mod unit_conversion;
|
||||
|
||||
|
||||
// Commonly used types across the services
|
||||
mod types {
|
||||
pub mod mac; // deprecated for the time being.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user