Skip to content

Commit

Permalink
fix(pg): Remove SIGINT capture and allow default node clean up (#1687)
Browse files Browse the repository at this point in the history
This is to address an issue when using a private db for more than 10 minutes,
and ctrl+c fails to exit. This commit removes an empty handler for SIGINT
which ends up preventing the default handling.

https://heroku.support/939668
  • Loading branch information
chadian authored Dec 1, 2020
1 parent 81888a0 commit 2b278f0
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions packages/pg-v5/lib/psql.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,14 @@ function psqlInteractive (dbEnv, prompt) {
})
}

function handleSignals () {
process.removeAllListeners('SIGINT')
process.on('SIGINT', () => {})
}

function * exec (db, query) {
handleSignals()
let configs = bastion.getConfigs(db)

yield bastion.sshTunnel(db, configs.dbTunnelConfig)
return yield execPsql(query, configs.dbEnv)
}

async function execFile (db, file) {
handleSignals()
let configs = bastion.getConfigs(db)

await bastion.sshTunnel(db, configs.dbTunnelConfig)
Expand All @@ -100,7 +93,6 @@ async function execFile (db, file) {
function * interactive (db) {
let name = db.attachment.name
let prompt = `${db.attachment.app.name}::${name}%R%# `
handleSignals()
let configs = bastion.getConfigs(db)
configs.dbEnv.PGAPPNAME = 'psql interactive' // default was 'psql non-interactive`

Expand Down

0 comments on commit 2b278f0

Please sign in to comment.