formating
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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