Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto start and stop Postgres on application start and close, respectively. #29

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

adrian-lara
Copy link
Contributor

@adrian-lara adrian-lara commented Oct 21, 2020

Postgres starts when the application is opened, and it's stopped when the application is closed.

Additionally, some of the previous visual components (and most of the methods producing them) have been removed.

In order to test this, take the following steps for both dev and prod (on Windows):

  • delete the PGDATA directory locally (start with a clean DB slate)

  • Start the app, and see that the app is initializing the DB while displaying the following: Screen Shot 2020-10-20 at 10 42 30 PM

  • After a few moments, the spinner should disappear: Screen Shot 2020-10-20 at 10 42 16 PM

  • Verify postgres is running on port 5442

  • Close the application

  • Verify postgres is no longer running

Note, I ran into an issue in PROD only where execSync (I ended up switching to spawnSync) couldn't navigate directories with spaces in the name, and it wasn't able to close Postgres. It could be worthwhile to test that the installed application can close Postgres when in PROD when the app is located in a directory with a space in the name.

@axelstudios
Copy link
Member

100% success with launching and having postgres start or reconnect to the running database
~50% success with closing the app and having postgres shutdown correctly.

I'll keep testing to try to find out why it doesn't always work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants