Added skip logic - Based on random sampling, when disk_space_mb=0, it is safe to entirely skip it

This commit is contained in:
2026-05-10 21:20:56 -04:00
parent 5a7fdd820b
commit 752c278dff
2 changed files with 112 additions and 6 deletions
+31
View File
@@ -122,6 +122,17 @@ def parse_args() -> argparse.Namespace:
"and report how many were re-queued. Run before resuming after a crash."
),
)
p.add_argument(
"--max-tiles",
type=int,
default=None,
metavar="N",
help=(
"Download at most N tiles per scan (default: all). "
"Pass 1 to probe a single tile — useful for quickly checking "
"whether a scan has real imagery or only placeholder responses."
),
)
p.add_argument(
"--verbose",
"-v",
@@ -145,6 +156,9 @@ def main() -> None:
if args.list_scans_first_page_only and not args.list_scans:
sys.exit("--list-scans-first-page-only requires --list-scans")
if args.scan_id is not None and args.scan_id <= 0:
sys.exit("--scan-id must be a positive integer")
# --list-machines doesn't need credentials
if args.list_machines:
base_url = "http://205.149.147.131:8010/"
@@ -270,6 +284,7 @@ def main() -> None:
mosaic_only=args.mosaic_only,
metadata_only=args.metadata_only,
scan_id_filter=args.scan_id,
max_tiles=args.max_tiles,
)
totals.merge(stats)
finally:
@@ -331,6 +346,22 @@ def _print_summary(
)
if not metadata_only and not mosaic_only:
log.info(row("Tiles downloaded:", str(totals.tiles_downloaded)))
if totals.scans_probe_skipped:
log.info(
row(
"Probe-skipped scans:",
str(totals.scans_probe_skipped),
"probe tile was 404 or placeholder; tile pool skipped",
)
)
if not metadata_only and totals.scans_disk_space_skipped:
log.info(
row(
"Zero-disk-space skipped:",
str(totals.scans_disk_space_skipped),
"disk_space_mb=0; mosaic and tiles not attempted",
)
)
if not dry_run and not metadata_only:
log.info(
row(