App Pool recycle causes db to be locked
ijason opened this issue · comments
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?
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.