Refactor DbContext access and disposal

- Remove instance queue. This is a database, after all, and is designed to be accessed and written to concurrently
- Reduce the number of calls to DbContexts.Create()
- Ensure that no LibationContext remains open across an await boundary. Multithread context access is the most likely culprit for past issues.
- Make all Update UserDefinedItem methods asynchronous.
This commit is contained in:
MBucari
2025-11-20 22:05:16 -07:00
parent f9ac0253fb
commit a55da5f187
25 changed files with 218 additions and 228 deletions

View File

@@ -277,7 +277,7 @@ public class ProcessQueueViewModel : ReactiveObject
else if (result == ProcessBookResult.FailedAbort)
Queue.ClearQueue();
else if (result == ProcessBookResult.FailedSkip)
nextBook.LibraryBook.UpdateBookStatus(LiberatedStatus.Error);
await nextBook.LibraryBook.UpdateBookStatusAsync(LiberatedStatus.Error);
else if (result == ProcessBookResult.LicenseDeniedPossibleOutage && !shownServiceOutageMessage)
{
await MessageBoxBase.Show($"""