mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-06 15:57:53 +10:00
Preserve tags for index-only adds
This commit is contained in:
@@ -109,7 +109,7 @@ def add(urls: str | list[str],
|
|||||||
print('[yellow]\\[*] Index-only mode - crawl created but not started[/yellow]')
|
print('[yellow]\\[*] Index-only mode - crawl created but not started[/yellow]')
|
||||||
# Create snapshots for all URLs in the crawl
|
# Create snapshots for all URLs in the crawl
|
||||||
for url in crawl.get_urls_list():
|
for url in crawl.get_urls_list():
|
||||||
Snapshot.objects.update_or_create(
|
snapshot, _ = Snapshot.objects.update_or_create(
|
||||||
crawl=crawl, url=url,
|
crawl=crawl, url=url,
|
||||||
defaults={
|
defaults={
|
||||||
'status': Snapshot.INITIAL_STATE,
|
'status': Snapshot.INITIAL_STATE,
|
||||||
@@ -118,6 +118,8 @@ def add(urls: str | list[str],
|
|||||||
'depth': 0,
|
'depth': 0,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
if tag:
|
||||||
|
snapshot.save_tags(tag.split(','))
|
||||||
return crawl.snapshot_set.all()
|
return crawl.snapshot_set.all()
|
||||||
|
|
||||||
# 5. Start the orchestrator to process the queue
|
# 5. Start the orchestrator to process the queue
|
||||||
|
|||||||
Reference in New Issue
Block a user