diff --git a/archivebox/core/admin_snapshots.py b/archivebox/core/admin_snapshots.py index 6abb2cee..8e2c7217 100644 --- a/archivebox/core/admin_snapshots.py +++ b/archivebox/core/admin_snapshots.py @@ -610,12 +610,12 @@ class SnapshotAdmin(SearchResultsAdminMixin, ConfigEditorMixin, BaseModelAdmin): if retried: messages.success( request, - f"Queued {retried} failed/skipped extractors for retry on this snapshot.", + f"Queued {retried} failed extractors for retry on this snapshot.", ) else: messages.info( request, - "No failed/skipped extractors were found on this snapshot.", + "No failed extractors were found on this snapshot.", ) return redirect(snapshot.admin_change_url) @@ -1377,10 +1377,10 @@ class SnapshotAdmin(SearchResultsAdminMixin, ConfigEditorMixin, BaseModelAdmin): if queued: messages.success( request, - f"Queued {queued} failed/skipped extractors for retry. The background runner will process them.", + f"Queued {queued} failed extractors for retry. The background runner will process them.", ) else: - messages.info(request, "No failed/skipped extractors were found in the selected snapshots.") + messages.info(request, "No failed extractors were found in the selected snapshots.") @admin.action( description="🆕 Archive Now", diff --git a/archivebox/core/models.py b/archivebox/core/models.py index c8266356..f3fd88f6 100644 --- a/archivebox/core/models.py +++ b/archivebox/core/models.py @@ -3017,17 +3017,13 @@ class Snapshot(ModelWithDeleteAfter, ModelWithOutputDir, ModelWithConfig, ModelW def retry_failed_archiveresults(self) -> int: """ - Reset failed/skipped ArchiveResults to queued for retry. + Reset failed ArchiveResults to queued for retry. Returns count of ArchiveResults reset. """ retryable_results = ArchiveResult.objects.filter( snapshot=self, - status__in=[ - ArchiveResult.StatusChoices.FAILED, - ArchiveResult.StatusChoices.SKIPPED, - ArchiveResult.StatusChoices.NORESULTS, - ], + status=ArchiveResult.StatusChoices.FAILED, ) legacy_result_count = retryable_results.filter(hook_name="").count() now = timezone.now() diff --git a/archivebox/tests/test_archive_result_service.py b/archivebox/tests/test_archive_result_service.py index 8011f5b9..c566f24d 100644 --- a/archivebox/tests/test_archive_result_service.py +++ b/archivebox/tests/test_archive_result_service.py @@ -385,6 +385,20 @@ def test_retry_failed_archiveresults_requeues_snapshot_in_queued_state(): output_size=123, output_mimetypes="text/plain", ) + ArchiveResult.objects.create( + snapshot=snapshot, + plugin="ublock", + hook_name="on_Snapshot__12_ublock", + status=ArchiveResult.StatusChoices.SKIPPED, + output_str="not applicable", + ) + ArchiveResult.objects.create( + snapshot=snapshot, + plugin="forumdl", + hook_name="on_Snapshot__50_forumdl", + status=ArchiveResult.StatusChoices.NORESULTS, + output_str="0 outputs", + ) reset_count = snapshot.retry_failed_archiveresults() @@ -402,6 +416,8 @@ def test_retry_failed_archiveresults_requeues_snapshot_in_queued_state(): assert result.output_mimetypes == "" assert result.start_ts is None assert result.end_ts is None + assert ArchiveResult.objects.get(snapshot=snapshot, plugin="ublock").status == ArchiveResult.StatusChoices.SKIPPED + assert ArchiveResult.objects.get(snapshot=snapshot, plugin="forumdl").status == ArchiveResult.StatusChoices.NORESULTS snapshot.refresh_from_db() assert snapshot.title in (None, "") _cleanup_machine_process_rows()