mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-29 14:05:21 -04:00
feat: Remove index.json and index.html generation from the regular process
This commit is contained in:
parent
494af5f2e1
commit
ae1484b8bf
5 changed files with 25 additions and 30 deletions
|
@ -225,7 +225,7 @@ def timed_index_update(out_path: Path):
|
|||
|
||||
@enforce_types
|
||||
def write_main_index(links: List[Link], out_dir: Path=OUTPUT_DIR, finished: bool=False) -> None:
|
||||
"""create index.html file for a given list of links"""
|
||||
"""Writes links to sqlite3 file for a given list of links"""
|
||||
|
||||
log_indexing_process_started(len(links))
|
||||
|
||||
|
@ -234,8 +234,6 @@ def write_main_index(links: List[Link], out_dir: Path=OUTPUT_DIR, finished: bool
|
|||
write_sql_main_index(links, out_dir=out_dir)
|
||||
os.chmod(out_dir / SQL_INDEX_FILENAME, int(OUTPUT_PERMISSIONS, base=8)) # set here because we don't write it with atomic writes
|
||||
|
||||
if finished:
|
||||
write_static_index(links, out_dir=out_dir)
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
stderr('[!] Warning: Still writing index to disk...', color='lightyellow')
|
||||
stderr(' Run archivebox init to fix any inconsisntencies from an ungraceful exit.')
|
||||
|
@ -246,13 +244,6 @@ def write_main_index(links: List[Link], out_dir: Path=OUTPUT_DIR, finished: bool
|
|||
|
||||
log_indexing_process_finished()
|
||||
|
||||
@enforce_types
|
||||
def write_static_index(links: List[Link], out_dir: Path=OUTPUT_DIR) -> None:
|
||||
with timed_index_update(out_dir / JSON_INDEX_FILENAME):
|
||||
write_json_main_index(links)
|
||||
with timed_index_update(out_dir / HTML_INDEX_FILENAME):
|
||||
write_html_main_index(links, out_dir=out_dir, finished=True)
|
||||
|
||||
@enforce_types
|
||||
def get_empty_snapshot_queryset(out_dir: Path=OUTPUT_DIR):
|
||||
setup_django(out_dir, check_db=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue