Skip to content

100% CPU usage in the dashboard fix #940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions pgml-dashboard/src/guards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rocket::request::{self, FromRequest, Request};
use sqlx::{postgres::PgPoolOptions, Executor, PgPool};

use crate::models;
use crate::{ClustersSettings, Context};
use crate::Context;

pub fn default_database_url() -> String {
match var("DATABASE_URL") {
Expand All @@ -25,20 +25,13 @@ impl Default for Cluster {
fn default() -> Self {
let max_connections = 1;
let min_connections = 1;
let idle_timeout = 0;

let settings = ClustersSettings {
max_connections,
idle_timeout,
min_connections,
};

Cluster {
pool: Some(
PgPoolOptions::new()
.max_connections(settings.max_connections)
.idle_timeout(std::time::Duration::from_millis(settings.idle_timeout))
.min_connections(settings.min_connections)
.max_connections(max_connections)
.idle_timeout(None)
.min_connections(min_connections)
.after_connect(|conn, _meta| {
Box::pin(async move {
conn.execute("SET application_name = 'pgml_dashboard';")
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy