Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

fix: force exit after psql closes #207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions commands/psql.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ function * run (context, heroku) {
process.stdout.write(yield psql.exec(db, flags.command))
} else {
yield psql.interactive(db)
// sometimes psql hangs and causes the stdout "drain" event not to be fired in cli-ux
// so we force an exit here
cli.exit(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the issue is that the CLI is waiting for a stdout event that is not coming? That is, we want to ensure that once psql exits, the command is done and any pending background processing is moot?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah exactly. It's strange that this doesn't have anything to do with stdout really, the issue is that somewhere in the code path some node task is starting and not quitting

}
}

Expand Down