archivebox.workers.tasks

Background task functions for queuing work to the background runner.

These functions queue Snapshots/Crawls for processing by setting their status to QUEUED so archivebox run --daemon or archivebox server can pick them up.

NOTE: These functions do NOT start the runner. They assume it’s already running via archivebox server or will be run inline by the CLI.

Module Contents

Functions

bg_add

Add URLs and queue them for archiving.

bg_archive_snapshots

Queue multiple snapshots for archiving via the shared runner loop.

bg_archive_snapshot

Queue a single snapshot for archiving via the shared runner loop.

API

archivebox.workers.tasks.bg_add(add_kwargs: dict) int[source]

Add URLs and queue them for archiving.

Returns the number of snapshots created.

archivebox.workers.tasks.bg_archive_snapshots(snapshots, kwargs: dict | None = None) int[source]

Queue multiple snapshots for archiving via the shared runner loop.

Returns the number of snapshots queued.

archivebox.workers.tasks.bg_archive_snapshot(snapshot, overwrite: bool = False, methods: list | None = None) int[source]

Queue a single snapshot for archiving via the shared runner loop.

Returns 1 if queued, 0 otherwise.