postgres_driver: remove duplicated const MaxNumConns. (#2106)

This commit is contained in:
Ivan FB 2023-10-04 15:28:07 +02:00 committed by GitHub
parent f05528d4be
commit c74abe131d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -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)

View File

@ -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] =