mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-29 05:55:28 -04:00
fix: Update command was failing
This commit is contained in:
parent
ab311d86e1
commit
13c3650637
2 changed files with 17 additions and 17 deletions
|
@ -83,17 +83,17 @@ def flush_search_index(snapshots: QuerySet):
|
|||
)
|
||||
|
||||
@enforce_types
|
||||
def index_links(links: Union[List[Link],None], out_dir: Path=OUTPUT_DIR):
|
||||
if not links:
|
||||
def index_snapshots(snapshots: Union[List[Model],None], out_dir: Path=OUTPUT_DIR):
|
||||
if not snapshots:
|
||||
return
|
||||
|
||||
from core.models import Snapshot, ArchiveResult
|
||||
|
||||
for link in links:
|
||||
snap = Snapshot.objects.filter(url=link.url).first()
|
||||
for snapshot in snapshots:
|
||||
snap = Snapshot.objects.filter(url=snapshot.url).first()
|
||||
if snap:
|
||||
results = ArchiveResult.objects.indexable().filter(snapshot=snap)
|
||||
log_index_started(link.url)
|
||||
log_index_started(snapshot.url)
|
||||
try:
|
||||
texts = get_indexable_content(results)
|
||||
except Exception as err:
|
||||
|
@ -103,4 +103,4 @@ def index_links(links: Union[List[Link],None], out_dir: Path=OUTPUT_DIR):
|
|||
color='red',
|
||||
)
|
||||
else:
|
||||
write_search_index(link, texts, out_dir=out_dir)
|
||||
write_search_index(snapshot, texts, out_dir=out_dir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue