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

localForage._dbInfo.db.close() #1006

Open
stepet80 opened this issue Dec 3, 2020 · 1 comment
Open

localForage._dbInfo.db.close() #1006

stepet80 opened this issue Dec 3, 2020 · 1 comment

Comments

@stepet80
Copy link

stepet80 commented Dec 3, 2020

We had the issue where db connections in localforage were kept open and tabs in the browser would wait for each other.
So we had to call following method in that pecific code:
localForage._dbInfo.db.close();

Would it be possible to make an official public method which would also take care of cleaning up the forage?

It should also have to clean up the dbContext.forages array.

@tofumatt
Copy link
Member

This is a bit scary because it would mean the localForage instance wouldn't be ready anymore. I guess you could close it and then subsequent calls would check for a ready DB and then open it again… I'm not opposed to making it a public method in 2.0 for advanced use-cases! I'll keep that in mind for the work I have in #906. 👍🏻

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

No branches or pull requests

2 participants