Add concurrent anime processing support

- Modified BackgroundLoaderService to use multiple workers (default: 5)
- Anime additions now process in parallel without blocking
- Added comprehensive unit tests for concurrent behavior
- Updated integration tests for compatibility
- Updated architecture documentation
This commit is contained in:
2026-01-24 17:42:59 +01:00
parent 04f26d5cfc
commit 8ff558cb07
6 changed files with 530 additions and 843 deletions

View File

@@ -175,7 +175,8 @@ class TestBackgroundLoaderIntegration:
shutdown_success = False
assert shutdown_success
assert loader.worker_task.done()
# Check all worker tasks are done
assert all(task.done() for task in loader.worker_tasks)
@pytest.mark.asyncio
async def test_no_duplicate_tasks(self):
@@ -226,8 +227,9 @@ class TestLoadingStatusEnum:
def test_loading_status_string_repr(self):
"""Test LoadingStatus can be used as strings."""
status = LoadingStatus.LOADING_EPISODES
assert str(status) == "loading_episodes"
assert status == "loading_episodes"
# The enum string representation includes the class name
assert status.value == "loading_episodes"
assert status == LoadingStatus.LOADING_EPISODES
class TestAsyncBehavior: