Add --retry-failed mode and mosaic retry estimates to progress report
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+47
-1
@@ -84,6 +84,33 @@ def parse_args() -> argparse.Namespace:
|
||||
"inventorying all scans across all machines."
|
||||
),
|
||||
)
|
||||
p.add_argument(
|
||||
"--retry-failed",
|
||||
action="store_true",
|
||||
help=(
|
||||
"Mosaic-only: re-attempt scans whose latest scans.csv row has "
|
||||
"mosaic_download_status=failed (queue from CSV, not the server list). "
|
||||
"Implies --mosaic-only."
|
||||
),
|
||||
)
|
||||
p.add_argument(
|
||||
"--retry-since",
|
||||
metavar="YEAR",
|
||||
default=None,
|
||||
help=(
|
||||
"With --retry-failed: only scans with scan_time year >= YEAR "
|
||||
"(e.g. 2023)."
|
||||
),
|
||||
)
|
||||
p.add_argument(
|
||||
"--retry-error-code",
|
||||
metavar="CODE",
|
||||
default=None,
|
||||
help=(
|
||||
"With --retry-failed: filter by mosaic_error_code "
|
||||
"(e.g. 200 for empty-body failures)."
|
||||
),
|
||||
)
|
||||
p.add_argument(
|
||||
"--dry-run",
|
||||
action="store_true",
|
||||
@@ -159,6 +186,16 @@ def main() -> None:
|
||||
if args.scan_id is not None and args.scan_id <= 0:
|
||||
sys.exit("--scan-id must be a positive integer")
|
||||
|
||||
if args.retry_since and not args.retry_failed:
|
||||
sys.exit("--retry-since requires --retry-failed.")
|
||||
if args.retry_error_code and not args.retry_failed:
|
||||
sys.exit("--retry-error-code requires --retry-failed.")
|
||||
|
||||
if args.retry_failed:
|
||||
if args.metadata_only:
|
||||
sys.exit("--retry-failed cannot be used with --metadata-only.")
|
||||
args.mosaic_only = True # implied
|
||||
|
||||
# --list-machines doesn't need credentials
|
||||
if args.list_machines:
|
||||
base_url = "http://205.149.147.131:8010/"
|
||||
@@ -261,7 +298,13 @@ def main() -> None:
|
||||
if args.metadata_only:
|
||||
log.info("Mode: metadata only (mosaics and tiles skipped)")
|
||||
elif args.mosaic_only:
|
||||
log.info("Mode: mosaics only (individual tiles skipped)")
|
||||
if args.retry_failed:
|
||||
log.info(
|
||||
"Mode: mosaic retry (failed scans from %s)",
|
||||
SCANS_CSV_FILENAME,
|
||||
)
|
||||
else:
|
||||
log.info("Mode: mosaics only (individual tiles skipped)")
|
||||
if args.dry_run:
|
||||
log.info("Mode: dry-run (no files will be written)")
|
||||
|
||||
@@ -285,6 +328,9 @@ def main() -> None:
|
||||
metadata_only=args.metadata_only,
|
||||
scan_id_filter=args.scan_id,
|
||||
max_tiles=args.max_tiles,
|
||||
retry_failed=args.retry_failed,
|
||||
retry_since_year=args.retry_since,
|
||||
retry_error_code=args.retry_error_code,
|
||||
)
|
||||
totals.merge(stats)
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user