fix: reset queue progress flag after queue completes

- Reset _queue_progress_initialized after each queue run so the next
  run re-creates the 'download_queue' progress entry
- Handle 'already exists' ProgressServiceError in _init_queue_progress
  as a no-op success to cover concurrent-start edge cases
- Guard stop_downloads() progress update to avoid crashing when the
  entry was never created
This commit is contained in:
2026-03-11 16:41:12 +01:00
parent db58ea9396
commit 0ec120e08f
2 changed files with 122 additions and 14 deletions

View File

@@ -121,4 +121,96 @@ For each task completed:
---
~~fix: on new added animes for the nfo the property plot is not loaded and written in nfo. make sure all properties are written on nfo creation~~ ✅ DONE
fix: download not working:
elf.\_progress_service.update_progress(
File "/app/src/server/services/progress_service.py", line 369, in update_progress
raise ProgressServiceError(
src.server.services.progress_service.ProgressServiceError: Progress with id 'download_queue' not found
2026-03-11 15:15:42 [info ] Processing next item from queue item_id=108 remaining=2 serie=I Was Reincarnated as the 7th Prince So I Can Take My Time Perfecting My Magical Ability
2026-03-11 15:15:42 [error ] Error in queue processing loop error=Progress with id 'download_queue' not found
Traceback (most recent call last):
File "/app/src/server/services/download_service.py", line 716, in \_process_queue
await self._progress_service.update_progress(
File "/app/src/server/services/progress_service.py", line 369, in update_progress
raise ProgressServiceError(
src.server.services.progress_service.ProgressServiceError: Progress with id 'download_queue' not found
2026-03-11 15:15:43 [info ] Processing next item from queue item_id=109 remaining=1 serie=I Was Reincarnated as the 7th Prince So I Can Take My Time Perfecting My Magical Ability
2026-03-11 15:15:43 [error ] Error in queue processing loop error=Progress with id 'download_queue' not found
Traceback (most recent call last):
File "/app/src/server/services/download_service.py", line 716, in \_process_queue
await self._progress_service.update_progress(
File "/app/src/server/services/progress_service.py", line 369, in update_progress
raise ProgressServiceError(
src.server.services.progress_service.ProgressServiceError: Progress with id 'download_queue' not found
2026-03-11 15:15:44 [info ] Processing next item from queue item_id=110 remaining=0 serie=I Was Reincarnated as the 7th Prince So I Can Take My Time Perfecting My Magical Ability
2026-03-11 15:15:44 [error ] Error in queue processing loop error=Progress with id 'download_queue' not found
Traceback (most recent call last):
File "/app/src/server/services/download_service.py", line 716, in \_process_queue
await self._progress_service.update_progress(
File "/app/src/server/services/progress_service.py", line 369, in update_progress
raise ProgressServiceError(
src.server.services.progress_service.ProgressServiceError: Progress with id 'download_queue' not found
2026-03-11 15:15:45 [info ] Queue processing completed - all items processed
ERROR: Task exception was never retrieved
future: <Task finished name='Task-16373' coro=<DownloadService.\_process_queue() done, defined at /app/src/server/services/download_service.py:688> exception=ProgressServiceError("Progress with id 'download_queue' not found")>
Traceback (most recent call last):
File "/app/src/server/services/download_service.py", line 755, in \_process_queue
await self._progress_service.complete_progress(
File "/app/src/server/services/progress_service.py", line 446, in complete_progress
raise ProgressServiceError(
src.server.services.progress_service.ProgressServiceError: Progress with id 'download_queue' not found
2026-03-11 15:15:46 [info ] Queue processing completed - all items processed
ERROR: Task exception was never retrieved
future: <Task finished name='Task-16313' coro=<DownloadService.\_process_queue() done, defined at /app/src/server/services/download_service.py:688> exception=ProgressServiceError("Progress with id 'download_queue' not found")>
Traceback (most recent call last):
File "/app/src/server/services/download_service.py", line 755, in \_process_queue
await self._progress_service.complete_progress(
File "/app/src/server/services/progress_service.py", line 446, in complete_progress
raise ProgressServiceError(
src.server.services.progress_service.ProgressServiceError: Progress with id 'download_queue' not found