Skip to content

Commit

Permalink
Connect using pg.ClientConfig (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
kesla authored and andywer committed Nov 5, 2018
1 parent 1e9b3c2 commit 7a2ee43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ export interface Options {
retryTimeout?: number
}

function connect (connectionConfig: pg.ConnectionConfig | undefined, options: Options) {
function connect (connectionConfig: pg.ClientConfig | undefined, options: Options) {
connectionLogger("Creating PostgreSQL client for notification streaming")

const { retryInterval = 500, retryLimit = Infinity, retryTimeout = 3000 } = options
const effectiveConnectionConfig: pg.ConnectionConfig = { ...connectionConfig, keepAlive: true }
const effectiveConnectionConfig: pg.ClientConfig = { ...connectionConfig, keepAlive: true }

const Client = options.native && pg.native ? pg.native.Client : pg.Client
const dbClient = new Client(effectiveConnectionConfig)
Expand Down Expand Up @@ -145,7 +145,7 @@ function scheduleParanoidChecking (dbClient: pg.Client, intervalTime: number, re
}
}

function createPostgresSubscriber (connectionConfig?: pg.ConnectionConfig, options: Options = {}) {
function createPostgresSubscriber (connectionConfig?: pg.ClientConfig, options: Options = {}) {
const { paranoidChecking = 30000 } = options

const emitter = new EventEmitter() as TypedEventEmitter<PgListenEvents>
Expand Down

0 comments on commit 7a2ee43

Please sign in to comment.