Skip to content

Commit

Permalink
comments removed
Browse files Browse the repository at this point in the history
  • Loading branch information
dzlk17 committed Dec 3, 2024
1 parent 4573f1a commit 79ae8be
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion database/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pub struct Db {
}

impl Db {
// CHECK THIS
pub async fn connect_to_the_pool() -> Db {
dotenvy::from_filename("infra/.env").unwrap();

Expand Down
1 change: 0 additions & 1 deletion server/src/cloud_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub struct CloudState {
pub grafana_client_conf: Arc<Configuration>,
}

// CHECK THIS
impl CloudState {
pub async fn new() -> Self {
let sessions_cache = get_new_session();
Expand Down
2 changes: 1 addition & 1 deletion server/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct ENV {
pub GF_SECURITY_ADMIN_PASSWORD: String,
pub MAILER_ACTIVE: bool,
}
// CHECK THIS

pub fn get_env() -> &'static ENV {
static INSTANCE: OnceCell<ENV> = OnceCell::new();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use openapi::{
use serde_json::Value;
use std::{env, sync::Arc};
use tokio::fs;
// CHECK THIS - used only at the begginning - better to have error

pub async fn setup_templates_dashboard(
grafana_conf: &Arc<Configuration>,
) -> Result<(), (StatusCode, String)> {
Expand Down
1 change: 0 additions & 1 deletion server/src/infra_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pub struct INFRA_ENV {
pub OFELIA_EMAIL_TO: String,
}

// CHECK THIS
pub fn get_env() -> &'static INFRA_ENV {
static INSTANCE: OnceCell<INFRA_ENV> = OnceCell::new();

Expand Down
2 changes: 1 addition & 1 deletion server/src/mailer/mailer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Mailer {
pub templates: Arc<HashMap<Templates, String>>,
pub mailbox: Mailbox,
}
// CHECK THIS

impl Mailer {
pub async fn init(username: String, password: String) -> Self {
let creds = Credentials::new(username.clone(), password);
Expand Down
1 change: 0 additions & 1 deletion server/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ pub struct ServerState {
pub cloud_state: Option<Arc<CloudState>>,
}

// CHECK THIS
impl FromRef<ServerState> for Arc<Db> {
fn from_ref(state: &ServerState) -> Self {
// Safe as middleware will prevent this from being None
Expand Down
1 change: 0 additions & 1 deletion server/src/statics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub const TEMPLATES_FOLDER_UID: &str = "TEMPLATE_FOLDER_UID";
pub const POSTGRES_DATASOURCE_UID: &str = "POSTGRES_DATASOURCE_UID";

// Name must be 3-30 characters long and include only alphanumeric characters, underscores, or slashes.
// CHECK THIS - all regex creation
pub static NAME_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new(r"^[a-zA-Z0-9_-]{3,30}$").expect("Regex creation failed"));

Expand Down
1 change: 0 additions & 1 deletion server/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ pub async fn start_transaction(
}
}

// CHECK THIS - used only at the begginning - better to have error
pub async fn import_template_dashboards(grafana_client: &Arc<Configuration>) {
// Check if folder exists if not create it
setup_templates_folder(&grafana_client).await.unwrap();
Expand Down

0 comments on commit 79ae8be

Please sign in to comment.