Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions transfers/backfill/backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,15 @@ def run(batch_size: int = 1000) -> None:
logger.info(f"Skipping backfill: {name} ({flag}=false)")
continue
logger.info(f"Starting backfill: {name}")
fn(batch_size)
logger.info(f"Completed backfill: {name}")
result = fn(batch_size)
logger.info(
f"Completed backfill: {name} — "
f"inserted={result.inserted} updated={result.updated} "
f"skipped_orphans={result.skipped_orphans} errors={len(result.errors)}"
)
if result.errors:
for err in result.errors:
logger.warning(f" {name}: {err}")


def _parse_args() -> argparse.Namespace:
Expand All @@ -68,8 +75,8 @@ def _parse_args() -> argparse.Namespace:
args = _parse_args()
try:
run(batch_size=args.batch_size)
except Exception as exc:
logger.critical(f"Backfill orchestration failed: {exc}")
except Exception:
logger.critical("Backfill orchestration failed", exc_info=True)
sys.exit(1)

# ============= EOF =============================================