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

App Pool recycle causes db to be locked #35

Open
ijason opened this issue Mar 29, 2023 · 1 comment
Open

App Pool recycle causes db to be locked #35

ijason opened this issue Mar 29, 2023 · 1 comment

Comments

@ijason
Copy link

ijason commented Mar 29, 2023

I have an ASP.NET Core app using Hangfire with LiteDB. When published to IIS 10 after the app pool recycles the app throws an error: The process cannot access the file '<PATH>\hf.db' because it is being used by another process.
The only way to fix this is to perform a second app pool recycle. I followed the instructions to make sure the app is always running.

Any fix for this?

@ijason
Copy link
Author

ijason commented Mar 30, 2023

Current workaround is to schedule two app pool recycles a minute after each other. The 1st recycle triggers at 5:00am and I can see in the logs that the DB is locked. The 2nd recycle triggers at 5:01am and everything is back to normal.

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

No branches or pull requests

1 participant