mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-06-01 07:18:27 -04:00
fix: Issue with oneshot command
This commit is contained in:
parent
876c269513
commit
f6c73f9aeb
3 changed files with 9 additions and 3 deletions
|
@ -111,9 +111,9 @@ def archive_link(link: Link, overwrite: bool=False, methods: Optional[Iterable[s
|
|||
link.history[method_name].append(result)
|
||||
|
||||
stats[result.status] += 1
|
||||
write_search_index(link=link, texts=result.index_texts)
|
||||
log_archive_method_finished(result)
|
||||
if not skip_index:
|
||||
write_search_index(link=link, texts=result.index_texts)
|
||||
ArchiveResult.objects.create(snapshot=snapshot, extractor=method_name, cmd=result.cmd, cmd_version=result.cmd_version,
|
||||
output=result.output, pwd=result.pwd, start_ts=result.start_ts, end_ts=result.end_ts, status=result.status)
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ DO NOT ADD ANY NEW FEATURES TO THIS FILE, NEW CODE GOES HERE: core/models.py
|
|||
__package__ = 'archivebox.index'
|
||||
|
||||
from pathlib import Path
|
||||
from django.db.utils import OperationalError
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
@ -352,7 +353,12 @@ class Link:
|
|||
### Archive Status Helpers
|
||||
@property
|
||||
def num_outputs(self) -> int:
|
||||
return self.as_snapshot().num_outputs
|
||||
try:
|
||||
return self.as_snapshot().num_outputs
|
||||
except OperationalError:
|
||||
return sum(1 for method in self.history.keys()
|
||||
for result in self.history[method]
|
||||
if result.status == 'succeeded')
|
||||
|
||||
@property
|
||||
def num_failures(self) -> int:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue