Skip to content
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

[gql] expose db_pool_size on ConnectionConfig #17595

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions crates/sui-graphql-rpc/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ pub enum Command {
/// DB URL for data fetching
#[clap(short, long)]
db_url: Option<String>,
/// Pool size for DB connections
#[clap(long)]
db_pool_size: Option<u32>,
/// Port to bind the server to
#[clap(short, long)]
port: Option<u16>,
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-graphql-rpc/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(crate) const DEFAULT_SERVER_CONNECTION_PORT: u16 = 8000;
pub(crate) const DEFAULT_SERVER_CONNECTION_HOST: &str = "127.0.0.1";
pub(crate) const DEFAULT_SERVER_DB_URL: &str =
"postgres://postgres:postgrespw@localhost:5432/sui_indexer";
pub(crate) const DEFAULT_SERVER_DB_POOL_SIZE: u32 = 3;
pub(crate) const DEFAULT_SERVER_DB_POOL_SIZE: u32 = 10;
pub(crate) const DEFAULT_SERVER_PROM_HOST: &str = "0.0.0.0";
pub(crate) const DEFAULT_SERVER_PROM_PORT: u16 = 9184;
pub(crate) const DEFAULT_WATERMARK_UPDATE_MS: u64 = 500;
Expand Down
4 changes: 3 additions & 1 deletion crates/sui-graphql-rpc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ async fn main() {
Command::StartServer {
ide_title,
db_url,
db_pool_size,
port,
host,
config,
node_rpc_url,
prom_host,
prom_port,
} => {
let connection = ConnectionConfig::new(port, host, db_url, None, prom_host, prom_port);
let connection =
ConnectionConfig::new(port, host, db_url, db_pool_size, prom_host, prom_port);
let service_config = service_config(config);
let _guard = telemetry_subscribers::TelemetryConfig::new()
.with_env()
Expand Down
Loading