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

fix: ensure correct application shutdown with forRootAsync and multiple databases #75

Merged
merged 3 commits into from
May 14, 2022

Conversation

tsangste
Copy link
Contributor

@tsangste tsangste commented May 13, 2022

When using forRootAsync module with multiple databases on application shutdown it fails to find MikroORM and causes a shutdown error.

NOTE: I tried to make a test for this in mikro-orm.middleware.test.ts but it seems the AfterAll lifecycle is swallowing the error and unsure if its a configuration issue as on other projects I've seen AfterAll fail on errors

…on shutdown it fails to find MikroORM and causes a shutdown error.
@B4nan
Copy link
Member

B4nan commented May 14, 2022

Thanks! The changes in lock file look weird, can you remove those please?

@tsangste
Copy link
Contributor Author

Thanks! The changes in lock file look weird, can you remove those please?

Sure can do! I just did a yarn install

@tsangste
Copy link
Contributor Author

hold on the PR for a sec found a bug

@B4nan
Copy link
Member

B4nan commented May 14, 2022

Weird that an install would alter lock file. I will rebuild it when releasing and update deps if needed.

@tsangste
Copy link
Contributor Author

Weird that an install would alter lock file. I will rebuild it when releasing and update deps if needed.

It could of been done with me trying to get sqlite working on this machine which stopped me from running the tests.

I have also resolved the bug 👍

@B4nan
Copy link
Member

B4nan commented May 14, 2022

Last time I had sqlite build issues installing node gyp as a dev dep explicitly helped. I can add that too, but I dont want to mix it with other changes in one PR.

@B4nan B4nan merged commit 91b6faf into mikro-orm:master May 14, 2022
@tsangste tsangste deleted the root_async_close_failing branch May 14, 2022 12:53
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.

None yet

2 participants