mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-27 07:06:42 +00:00
postgres_driver: remove duplicated const MaxNumConns. (#2106)
This commit is contained in:
parent
f05528d4be
commit
c74abe131d
@ -81,8 +81,7 @@ proc new*(T: type ArchiveDriver,
|
|||||||
|
|
||||||
of "postgres":
|
of "postgres":
|
||||||
when defined(postgres):
|
when defined(postgres):
|
||||||
const MaxNumConns = 5 #TODO: we may need to set that from app args (maybe?)
|
let res = PostgresDriver.new(dbUrl = url, onErrAction = onErrAction)
|
||||||
let res = PostgresDriver.new(url, MaxNumConns, onErrAction)
|
|
||||||
if res.isErr():
|
if res.isErr():
|
||||||
return err("failed to init postgres archive driver: " & res.error)
|
return err("failed to init postgres archive driver: " & res.error)
|
||||||
|
|
||||||
|
@ -40,11 +40,11 @@ proc insertRow(): string =
|
|||||||
"""INSERT INTO messages (id, storedAt, contentTopic, payload, pubsubTopic,
|
"""INSERT INTO messages (id, storedAt, contentTopic, payload, pubsubTopic,
|
||||||
version, timestamp) VALUES ($1, $2, $3, $4, $5, $6, $7);"""
|
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,
|
proc new*(T: type PostgresDriver,
|
||||||
dbUrl: string,
|
dbUrl: string,
|
||||||
maxConnections: int = DefaultMaxConnections,
|
maxConnections: int = MaxNumConns,
|
||||||
onErrAction: OnErrHandler = nil):
|
onErrAction: OnErrHandler = nil):
|
||||||
ArchiveDriverResult[T] =
|
ArchiveDriverResult[T] =
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user