From c74abe131d00988cc69933525ad2d8c206bf0e63 Mon Sep 17 00:00:00 2001 From: Ivan FB <128452529+Ivansete-status@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:28:07 +0200 Subject: [PATCH] postgres_driver: remove duplicated const MaxNumConns. (#2106) --- waku/waku_archive/driver/builder.nim | 3 +-- waku/waku_archive/driver/postgres_driver/postgres_driver.nim | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/waku/waku_archive/driver/builder.nim b/waku/waku_archive/driver/builder.nim index f8a47afd7..2db18515b 100644 --- a/waku/waku_archive/driver/builder.nim +++ b/waku/waku_archive/driver/builder.nim @@ -81,8 +81,7 @@ proc new*(T: type ArchiveDriver, of "postgres": when defined(postgres): - const MaxNumConns = 5 #TODO: we may need to set that from app args (maybe?) - let res = PostgresDriver.new(url, MaxNumConns, onErrAction) + let res = PostgresDriver.new(dbUrl = url, onErrAction = onErrAction) if res.isErr(): return err("failed to init postgres archive driver: " & res.error) diff --git a/waku/waku_archive/driver/postgres_driver/postgres_driver.nim b/waku/waku_archive/driver/postgres_driver/postgres_driver.nim index 7826d944b..775b34877 100644 --- a/waku/waku_archive/driver/postgres_driver/postgres_driver.nim +++ b/waku/waku_archive/driver/postgres_driver/postgres_driver.nim @@ -40,11 +40,11 @@ proc insertRow(): string = """INSERT INTO messages (id, storedAt, contentTopic, payload, pubsubTopic, version, timestamp) VALUES ($1, $2, $3, $4, $5, $6, $7);""" -const DefaultMaxConnections = 5 +const MaxNumConns = 5 #TODO: we may need to set that from app args (maybe?) proc new*(T: type PostgresDriver, dbUrl: string, - maxConnections: int = DefaultMaxConnections, + maxConnections: int = MaxNumConns, onErrAction: OnErrHandler = nil): ArchiveDriverResult[T] =