Antennas basic endpoints #4

Merged
fdiniello merged 7 commits from basic-core-rocket into develop 2023-07-23 18:53:50 +02:00
3 changed files with 4 additions and 11 deletions
Showing only changes of commit cb7b62a092 - Show all commits

View File

@@ -10,7 +10,6 @@ pub mod postgres;
pub mod mqtt; pub mod mqtt;
pub mod unit_conversion; pub mod unit_conversion;
// Commonly used types across the services // Commonly used types across the services
mod types { mod types {
pub mod mac; // deprecated for the time being. 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::prelude::*;
use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
pub type DbConn = diesel::pg::PgConnection; pub type DbConn = diesel::pg::PgConnection;
// pub type DbPooledConn = PooledConnection<ConnectionManager<PgConnection>>;
pub type DbPool = Pool<ConnectionManager<PgConnection>>; pub type DbPool = Pool<ConnectionManager<PgConnection>>;
pub struct DbPooledConn(pub PooledConnection<ConnectionManager<PgConnection>>); pub struct DbPooledConn(pub PooledConnection<ConnectionManager<PgConnection>>);
pub fn establish_connection() -> DbConn { pub fn establish_connection() -> DbConn {
let database_url = dotenv::var("DATABASE_URL").expect("DATABASE_URL must be set"); let database_url = dotenv::var("DATABASE_URL").expect("DATABASE_URL must be set");
PgConnection::establish(&database_url) PgConnection::establish(&database_url)

View File

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