sync errors
This commit is contained in:
@@ -81,6 +81,7 @@ def run_sync(limit: int | None = None) -> None:
|
||||
books = extractor.extract(local_zip, work_dir / "extracted")
|
||||
log.info("Extract done in %.1fs — %d book(s)", time.monotonic() - t1, len(books))
|
||||
|
||||
books_errored_this_zip = 0
|
||||
for book in books:
|
||||
t2 = time.monotonic()
|
||||
status = client.upload(book, zip_source=remote_zip.remote_path)
|
||||
@@ -91,6 +92,11 @@ def run_sync(limit: int | None = None) -> None:
|
||||
counters["books_skipped"] += 1
|
||||
else:
|
||||
counters["books_errored"] += 1
|
||||
books_errored_this_zip += 1
|
||||
|
||||
if books_errored_this_zip:
|
||||
zip_status = "error"
|
||||
zip_error = f"{books_errored_this_zip} book upload(s) failed — will retry next sync"
|
||||
|
||||
extractor.cleanup(work_dir / "extracted" / local_zip.stem)
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user